Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'regex tweak' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
regex tweak
Authored by: cynikal on Feb 17, '03 05:09:41PM

shouldn't that regex be '.*\.[Mm][Pp]3', with the difference being the period in the filename should be escaped, otherwise the period in the regex matches any character, not only a period. with the other regex it could match a file named: something.else.other.than.anmp3

it probably isn't a problem as there probably aren't any files actually named that but just for the same of correctness :)

oh and while we're on the low probability of misleading/tricky filenames, this would probably work just fine:

find . -name '*.??3'

matching all files w/ 3 letter extensions ending with the number 3.

[ Reply to This | # ]

regex tweak
Authored by: Pi_ on Feb 17, '03 06:20:21PM

That's not a regex there, son. It's a shell Glob. That's perfectly fine the way it is.



[ Reply to This | # ]
regex tweak
Authored by: Pi_ on Feb 17, '03 06:42:31PM

Woops. If it were the -name parameter it would be fine as is.. :-|

Pi



[ Reply to This | # ]
regex tweak
Authored by: Ralf Canis on Feb 18, '03 07:31:01AM

How about:
find . -iname '*.mp3'



[ Reply to This | # ]