tl;dr: Use \A and \z rather than ^ and $ in regexps, because the latter two match newlines in the middle of strings, whereas the former strictly only match the beginning and end of strings.
I thought this was common knowledge, but it's a good reminder for anyone who doesn't know.
I have no ruby knowledge of any kind. Do you mean this is common knowledge in the relevant field?
The regular expressions I _am_ familiar with would work as expected and usually need a special modifier/flag to match over multiple lines. So - I learned something new.
While I would agree that ^$ are the standard and probably vastly used around the Ruby world (so good job calling us on it Egor), it is nice to see http://rubular.com/ mention \A and \Z in its Regex Quick Reference.
honestly, I have no idea what really brogrammer means :D Just sounds funny to me. Removed that! Sorry if it was not called for, I did it not by purpose.
I thought this was common knowledge, but it's a good reminder for anyone who doesn't know.