3

The effect of a backslash in the regular expression part of [[ str =~ rex ]] is to quote the following character (exactly like putting it in single quotes), which would direct bash to do a literal match for it (1). Since b is not special, \b will turn into just b, but '\', "\\" or \\ will turn into \\ in order to match a literal backslash: [[ ...


Only top voted, non community-wiki answers of a minimum length are eligible