Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Every REGEXP switch and option

by Kozz (Friar)
on Mar 27, 2000 at 00:16 UTC ( #6187=perlquestion: print w/replies, xml ) Need Help??
Kozz has asked for the wisdom of the Perl Monks concerning the following question:

Is there a good plce to find information on all the available special characters, switches, options that can be used in a REGEXP string matching & searches? I feel comfortable with REGEXPs to a point, but I want to learn more about how they are used in matching, with things like m//g or s// or tr//isgcemx and all those letters that come BEFORE and AFTER the first and last slashes... Do I need to buy a book? Or is there a good webpage/site on this?

Replies are listed 'Best First'.
RE: Every REGEXP switch and option
by chromatic (Archbishop) on Mar 27, 2000 at 00:32 UTC
    The first place to start is perldoc perlre. If you're in a Unixy environment, just type that at a command prompt (I think it works that way in Windows too, but I rarely program there). With the Activestate compiler, HTML documentation is installed in your Start menu.

    From there, two excellent books are Programming Perl (from O'Reilly) and Mastering Regular Expressions (also from O'Reilly). Both are a little bit dated, but they'll have 98% of the information you're likely to need. Also check out places like perl.com for more up-to-the-minute information.

Re: Every REGEXP switch and option
by btrott (Parson) on Mar 27, 2000 at 00:31 UTC
    Have you looked at perlop and perlre? Those are, probably, the definitive sources on the regex switches and options. You might also take a look at Jeffrey Friedl's book, Mastering Regular Expressions. It's a bit outdated now, since there's been a lot of new regex functionality added since the book was published; but it's still a good source.

    By the way: the possible switches for the tr operator are

    tr//cds
Re: Every REGEXP switch and option
by turnstep (Parson) on Mar 28, 2000 at 22:44 UTC

    Another good source is the Perl Cookbook, Chapter 6. While it obviously cannot cover as much in one chapter as the Mastering Regular Expressions book, the chapter is excellent with many "recipes" and a good style that goes beyond the information in Programming Perl. Plus, you'll find the book invaluable for other things as well. Highly recommended. Available, of course, from O'Reilly:

    Perl Cookbook

    Update: Better yet, buy it through the unholy alliance of Fatbrain and Perlmonks here: Perl Cookbook :)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://6187]
Approved by root
help
Chatterbox?
[LanX]: qwiud you sthink so?
[LanX]: zxwqbd good idea! :)
LanX embraces his new habit spqopiwjdnq
[ambrus]: qQUkZTmHTuKxStGT- BzTIK9gdudif7TkTLI t3mnF144UaAZjkknXY 8nN-QM19wHBsTrp5vB lEYU_Kksa7X1RIBB4x EWLD5X7SW3jGX5ryfN OMn_yL5FTdQxzjhtyX mKN9sjUCzBNHK5Rrp0 S2WMUvIb1i9aZFgjtq VR0GH1bjPMvm1G16iz hBqc1U6toPd4FbJOFj VsOeT745AN1_pO88rD SRAYKtBZwCZedESZmN mvutrOTHiSNwflB- pRfn_k
[Eily]: so far it seems to work
Your Mother reminds the monks they should be grateful not to share an office, lest they be subjugated to constant inanities like, "Czech please!"
[LanX]: what's strange is that the "Cowboy you said this already" message is missing #dqiwd
[LanX]: YM: BTW learn to mute your humanity
[Your Mother]: Cumin? Now I want tacos...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (14)
As of 2017-03-27 16:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (320 votes). Check out past polls.