* Regexp ^ and $ work match more than just start and end of string. For
example, /^abc$/ does not match only "abc" but also "rm -rf /*\nabc"
Are you aware of the \A, and \Z regexp matchers - matches the start
and end of a string while ^, and $ match before and after newline.
···
--
Anurag Priyam
http://about.me/yeban/
Anurag Priyam wrote in post #975100:
* Regexp ^ and $ work match more than just start and end of string. For
example, /^abc$/ does not match only "abc" but also "rm -rf /*\nabc"
Are you aware of the \A, and \Z regexp matchers - matches the start
and end of a string while ^, and $ match before and after newline.
Actually, the correct answer is \A and \z if you want to match start and
end of string.
Yes, the facility exists. But people may be tripped up by this, which is
why I mention it.
Also, ruby // is like perl //m.
ruby //m is like perl //s.
···
--
Posted via http://www.ruby-forum.com/\.