in reply to Re: how to state this by REL
in thread how to state this by REL

Howdy!

I wouldn't change that RE. Since you had to look up \A and \z, did you also look up ^ and $? They don't do what you say they do. \A and \z do exactly what you attribute to ^ and ?.

Further, escaping . in a character class is gratuitous.

To elaborate: ^ matches the beginning of the line, while $ matches the end of the line (unless the line ends with a newline, in which case the anchor matches before the newline. \A is always the start of the string. \z is always the end of the string. ^ and $ depend on whether you are using the /m modifier or not.

TheDamian makes fair arguments for using \A and \z (along with /x, /m, and /s routinely). The core argument is that doing so makes your regexen behave with less surprising behavior all the time. Consistency, and all that.

yours,
Michael