Akinori MUSHA wrote:
>
> Hi,
>
> I have implemented -regex and -iregex options for find(1):
>
> http://people.FreeBSD.org/~knu/misc/find_regex.diff
I'm not familiar with find sources, but it seems to me you execute
regcomp() for each file name to be compared? If so... change that! :-)
Regcomp() does expensive setup so that regexec() can be run
inexpensively many times over.
> They are meant to be compatible with those of GNU's and NetBSD's:
>
> -regex <pattern>:
>
> True if the whole path of the file matches <pattern> using
> basic regular expression. To match a file named
> ``./foo/xyzzy'', you can use the regular expression
> ``.*/[xyz]*'' or ``.*/foo/.*'', but not ``xyzzy'' or
> ``/foo/''.
>
> -iregex <pattern>:
>
> Like -regex, but the match is case insensitive.
You forgot -E (use extended regexp syntax), and the example you show
above is extended regexp syntax, not basic regexp syntax.
> I'd like to commit it after reviews if there is no convincing
> objection against it. Any suggestion is welcome.
Well, I expressed my concerns above.
--
Daniel C. Sobral (8-DCS)
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
"Too bad sentience isn't a marketable commodity."
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message