I'm using the find
command in Mac OS X 10.9, I tried commands like this:
$ touch "a gre a"
$ find -E . -iregex ".*\bgre\b.*"
It looks that the find
will not return this file named a gre a
.. Does anyone have ideas about this? Thanks!
I'm using the find
command in Mac OS X 10.9, I tried commands like this:
$ touch "a gre a"
$ find -E . -iregex ".*\bgre\b.*"
It looks that the find
will not return this file named a gre a
.. Does anyone have ideas about this? Thanks!
find
command's regex engine (ERE) doesn't support \b
for word boundaries.
On OSX following will work for word boundaries:
find -E . -iregex ".*[[:<:]]gre[[:>:]].*"