find and regular expressions
Hi all,
I could be me, but i don't seem to be able to make find working with regular expressions :-( I've tried the parameter -regex followed by a countless number of attempts to get something out of it with no luck. What I'm trying to find is: 1) directory names that have no space or multiple spaces before the character "[" 2) directory names where tha value between square brackets is higher than 2012 e.g. "[2200]" When I test my regular expressions against a regular-expression verification software it does the job, but when i use the very same strings with find... no luck! e.g. mywonderfuldirectory [2459] find . -type d -regex ".*\[[0-9]{4}\]" nothing is found Can anybody please provide a working example? Many thanks!!! |
I think I've found the solution, find really needs the parameter:
-regextype posix-extended now it works :-) |
You may already know this, but many utilities require some kind of option setting when using extended regexes---eg
grep -e (or egrep) sed -r |
Quote:
|
Quote:
|
All times are GMT -5. The time now is 09:58 AM. |