I try to get all files like scheme_12.sql and scheme_23_analytics.sql from folder with bash and regex works in a strange way in terminal, doesn't return anything. Also checked in python re and some interactive regex sites. It works.
my command ls | find . -type f -regex "\.\/scheme_[0-9]+_([a-zA-Z]+)?.sql"
but command without optional sentence works ls | find . -type f -regex "\.\/scheme_[0-9]+.sql"
I have no idea why. Can you help me find a mistake?