Hello. I'll try to keep this short: In Cygwin only, using bash 5.2.21-1 or 5.2.15-3 (the only 5.* versions available), "empty" in a regular expression is not properly matched and breaks the regular expression. It's not a quoting issue, I also tested with: reg='foo|'; [[ foo =~ $regex ]]
GNU bash, version 5.2.15(3)-release (x86_64-pc-cygwin) GNU bash, version 5.2.21(1)-release (x86_64-pc-cygwin) [[ foo =~ foo| ]] (is false, should be true) [[ foo =~ foo|a ]] (is true) [[ '' =~ foo| ]] (is false, should be true) GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu) GNU bash, version 5.2.21(1)-release (x86_64-pc-linux-gnu) [[ foo =~ foo| ]] (is true) [[ foo =~ foo|a ]] (is true) [[ '' =~ foo| ]] (is true) Thank you, LLoyd -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple