This question already has an answer here:
I've got a set of files in a directory, all of the format test[0-9][0-9].txt
. If I run
find . -regex ".*/(test)[0-9][0-9]\.txt"
then all the files are shown, but if I run
find . -regex ".*/(test)[0-9]{2}\.txt"
then none are shown. What am I doing wrong?!
I've had a search through previous similar questions to this, but can't find a particularly relevant answer
find
obviously expects the former by default. You don't say what system you're on - yourfind
might have a switch to turn on extended regexp parsing. On FreeBSD, for example, it's-E
– D_Bye Nov 23 '15 at 12:27-regextype posix-extended
and that doesn't work either – ChrisW Nov 23 '15 at 12:33