Hacker News new | ask | show | jobs
by paulryanrogers 3769 days ago
Less code is generally better. But I've noticed a lot of folks still using ^ or $ when what they really mean is \A or \z
1 comments

What's the difference? ^ and $ is basically all I remember from when I read Mastering Regular Expressions
\A and \z always match beginning/end of the string.

^ and $ can be changed to mean beginning/end of each line in the string with the /m flag.