Odi's astoundingly incomplete notes
New entries | Codebash regex and quotes
[[ "a b c" =~ "a (.) c" ]] Bash once returned the expected results from the above statement. Due to a parser change, bash now ignores reserved regex characters in the right-hand side of =~ if quotes are used, and treats them as literals. This is how to do the above now:
[[ "a b c" =~ a\ (.)\ c ]]
or
V="a b c"
RE="a (.) c"
[[ ${V} =~ ${RE} ]]
I suppose I should have caught this in the Release Notes or something, but you are the only person to have signaled this.