views:

87

answers:

3

I've been having a need to do a lot of regex / pattern-matching stuff lately and, in looking at different examples / forum posts from my web searches it seems people sometimes mention that perl has good modules to help in simplifying pattern matching / regex tasks, however they neglect to mention which ones are the best for this.. I have looked at CPAN for this but their site isn't very easy to navigate as I can't seem to search effectively by category.. any advice is appreciated.

+7  A: 

Take a look at Regexp::Common

Also, look at YAPE::Regex::Explain and the web front end to it. Invaluable.

drewk
Thanks.. I will
Rick
Also reading mastering regular expression becomes a must when you want to do a lot with Regex.
thegeek
drewk
+3  A: 

Might I suggest the perl6-esque Regexp::Grammars if you're doing anything really complex and need to write a grammar -- it is really awesome. I just used it to parse a few SQL commands for my perl postgresql shell: pgperlshell

Evan Carroll
Thanks.. this looks great
Rick
+2  A: 

A lot of the power of regular expressions is available natively in perl. Probably the best way for you to simplify your understanding of perl regular expressions is to read the excellent perl regex tutorial at http://perldoc.perl.org/perlretut.html

dalton
+1 for the excellent reference to what should be the first read document.
drewk