find command with regex quantifier e.g. {1,2}

If you have GNU find, you can use another regular expression type:

find . -regextype sed -regex '.*myfile[0-9]\{1,2\}'

According to GNU find uses a neutered Emacs regular expression syntax by default - Emacs supports \{from,to\} syntax, but at least GNU find doesn't support it.

Strangely, the reference manual doesn't include a section on the sed regular expression syntax, so who knows which parts of it are supported.


You could try

find . -regex '.*myfile[0-9][0-9]?'

or

find . \( -name "myfile[0-9][0-9]" -o -name "myfile[0-9]" \)