Wednesday, August 1, 2012

Regexp::Common : "the various patterns are not anchored"

Regexp::Common - Provide commonly requested regular expressions - metacpan.org

The various patterns are not anchored. ... This is by design, and not a bug. If you want the pattern to be anchored, use something like: ...

I.e. enclose it in something like this: m{^RE{...}$} !

And as opposed to advises elsewhere by the original author of the package (being also the author of "... Best Practices" – but then, you do know this: style develops through time, right?), do not add "xms". Why? You might have white space within a "-pat" directive and the "x" swallows the white space.

No comments: