Not to be overly nitpicky, but that behavior is from the m// operator, not =~. I think this distinction is important to keep in mind, because =~ can be used with m//, s/// and tr///, which all have different behaviour.
In reply to Re^3: Explaining =~ and .= operators
by revdiablo
in thread Explaining =~ and .= operators
by Thelonius Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |