So I got the following find
command:
find ./test-folder -type d -mindepth 1 -regex "^.*/\d\{4\}-\d\{2\}-\d\{2\}$"
Previously I've created the folder ./testfolder
by mkdir testfolder
and a folder in it mkdir ./testfolder/2022-10-12
.
When running the find
command with Bash in an alpine-based docker container everything works fine and it outputs /path/to/testfolder/2022-10-12
If I run the same command in bash on my Lubuntu machine it won't output anything.
I have not modified the find command or anything around it, I expected it to work on any machine, but the regex seems to behave differently. Matching *
works, also matching an infinite number of digits \d*
works, but as soon as I try to match -
or use quantifiers as {4}
it won't match anything anymore.
What could be the issue here? Moreover, how can I make it work on LUbuntu?
Not even
– Rudolf Oct 12 '22 at 10:56-regex "\d\d\d\d-\d\d-\d\d"
works for me.