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!!!
Last edited by rs232; 08-10-2012 at 04:05 AM.
Reason: improvement
|