^
, $
matches beginning/end of line in Ruby.
While in another languages, ^
, $
matches the beginning/end of the string unless multiline mode (m
) is specified. (Some regular expression engine requires g
flag to match multiple times.)
Решение
^
, $
matches beginning/end of line in Ruby.
While in another languages, ^
, $
matches the beginning/end of the string unless multiline mode (m
) is specified. (Some regular expression engine requires g
flag to match multiple times.)