- May 20, 2008
I'm having a tough time understanding how the =~ test works.
Above, the first is expected (?). Why not the same result in the second? [In my experience, both strings should be un-quoted before handing them off to Oniguruma]. The fact that the first works suggests that any match found yields a positive result. Then why is the fourth one above negative?
v:\> if de =~ e+$ echo yes yes v:\> if "de" =~ "e+$" echo yes v:\> if "a b c" =~ ". . ." echo yes yes v:\> if "a b c" =~ ". ." echo yes v:\>