|
|
|
|
|
by cduan
5142 days ago
|
|
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. |
|
They typically also use and/or instead of &&/|| and potentially introduce subtle bugs into their code when the former would suffice.