perlfaq6
Current Perl documentation can be found at perldoc.perl.org.
Here is our local, out-dated (pre-5.6) version:
This section is surprisingly small because the rest of the FAQ is littered with answers involving regular expressions. For example, decoding a URL and checking whether something is a number are handled with regular expressions, but those answers are found elsewhere in this document (in the section on Data and the Networking one on networking, to be precise).How can I hope to use regular expressions without creating illegible and unmaintainable code?
I'm having trouble matching over more than one line. What's wrong?
How can I pull out lines between two patterns that are themselves on different lines?
I put a regular expression into $/ but it didn't work. What's wrong?
How do I substitute case insensitively on the LHS, but preserving case on the RHS?
How can I make <CODE>\w</CODE> match national character sets?
[How can I match a locale-smart version of
/a-zA-Z/
?]How can I quote a variable to use in a regexp?
What is <CODE>/o</CODE> really for?
How do I use a regular expression to strip C style comments from a file?
Can I use Perl regular expressions to match balanced text?
What does it mean that regexps are greedy? How can I get around it?
How do I process each word on each line?
How can I print out a word-frequency or line-frequency summary?
How can I do approximate matching?
How do I efficiently match many regular expressions at once?
Why don't word-boundary searches with <CODE>\b</CODE> work for me?
Why does using $&, $`, or $' slow my program down?
What good is <CODE>\G</CODE> in a regular expression?
Are Perl regexps DFAs or NFAs? Are they POSIX compliant?
What's wrong with using grep or map in a void context?
How can I match strings with multibyte characters?