Y
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
voltagex_
3769 days ago
What's the difference? ^ and $ is basically all I remember from when I read
Mastering Regular Expressions
link
eCa
3769 days ago
\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.
link