in reply to how to state this by REL
The simple reason being I had to lookup what \A and \z do. Far more common anchors for matching the beginning and end of strings are ^ and $. Even the documentation describes them as "The two most common anchors".
so I'd change it to
I might even be tempted to explicitly escape that '.', even though it's not strictly necessary.$name =~ /^[a-zA-Z][\w.-]*$/
To me, that makes it more obvious that we're matching a dot.$name =~ /^[a-zA-Z][\w\.-]*$/
I wonder what percentage of 'average ability' Perl programmers could tell you the subtle difference between \z and \Z without reference to a manual?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: how to state this by REL
by herveus (Prior) on Nov 09, 2005 at 13:43 UTC |