suppose I have two files: ac
and abc
. I want to find a regex to match both files. Normally I would expect the following regex to work, but it never does:
find ./ -name ab?c
I have tried escaping or not the questionmark, this never seems to work. Normally in the regex documentations I have found; ?
means: previous character repeated 0 or 1 times, but find
doesn't seem to understand this.
I have tried this on two different find versions: GNU find version 4.2.31 and find (GNU findutils) 4.6.0
PS: this works with *
, but I specifically would like to match just one optional character.
find ./ -name a*c
gives
./ac
./abc