Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

I resolve to finally grok and use the regex option...

by tye  (Monk)
on Apr 23, 2005 at 05:50 UTC ( #450653=poll: print w/ replies, xml ) Need Help??

vote on I resolve to finally grok and use the regex option...

/m
[bar] 26/9%
/e
[bar] 35/12%
/x
[bar] 75/25%
/i
[bar] 25/8%
/c
[bar] 50/16%
/o
[bar] 23/8%
/g
[bar] 43/14%
/s
[bar] 27/9%
304 total votes
Comment on I resolve to finally grok and use the regex option...
Re: I resolve to finally grok and use the regex option...
by ambrus (Abbot) on Apr 23, 2005 at 13:22 UTC

    I routinely use g, s, and sometimes even i, e, x, c. I even know what o and m means, but I haven't find any use for them.

    However, I am all confused when I write regexen in ruby, because the m option for ruby regexps is the same as the s in perl. Even worse, if you write s by habit, you don't even get a warning because it has a different meaning.

    Update 2007 jan 22: since then, I've found a use for m as well.

      You might not use them because there are other ways to get around them. For instance, with qr//, you don't need to ever use m//o. m//m can be useful when you're trying to read in data records, but you can also match on the line seperator with a lookahead or lookbehind assertion. (or line seperator or \A or \Z, it you might match the very beginning or very end)

      <s>You use /c? What is it, and why can't I find anything about it in perlre?</s>

      Update: never mind. Resolved in the CB. For any others curious, it's in perlop, not perlre.

      ------------ :Wq Not an editor command: Wq
        This was new to me too. I found some additional information on /c in perlretut.

        /c (in conjunction with /g) is great for tokenization. See Using Multiple m/\G.../gc to Tokenize for an example. There's another example in perlfaq.

        I've actually used all of the options listed in the poll.

Re: I resolve to finally grok and use the regex option...
by japhy (Canon) on Apr 23, 2005 at 13:37 UTC
    Finally? You don't know me very well.
    _____________________________________________________
    Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
    How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart
Re: I resolve to finally grok and use the regex option...
by cog (Parson) on Apr 23, 2005 at 15:36 UTC
    Has anybody else noticed the first six options are /mexico ? :-)

    I'm not sure I want to use a country... :-)

      You can spell "sexgismo" with them too. Not that you'd want to...
      _____________________________________________________
      Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
      How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart

        But "sexgismo" has s twice and no c.

      Yeah, but if you take away all the ones that are going away in Perl 6, all you're left with is "ig", which can only be construed as the country code for "Iguana". (Unless it's "gi", which is the code for Gilligan's Island. Hmm, that would explain a lot about Perl 6...)
      Has anybody else noticed the first six options are /mexico ? :-)

      I had no idea that Larry Wall was a fan of Atlanta Falcons quarterback Michael Vick.

      --
      tbone1, YAPS (Yet Another Perl Schlub)
      And remember, if he succeeds, so what.
      - Chick McGee

      And the last four are /cogs. What's that about, cog?

      Caution: Contents may have been coded under pressure.
        Schiiuuuu... keep it down, they might hear you O:-)
Re: I resolve to finally grok and use the regex option...
by ambs (Pilgrim) on Apr 24, 2005 at 18:03 UTC
    And what about /eee?

    Alberto Simões

Re: I resolve to finally grok and use the regex option...
by wolfger (Deacon) on Apr 25, 2005 at 01:29 UTC

    What about /. ?


    --
    Linux, sci-fi, and Nat Torkington, all at Penguicon 3.0
    perl -e 'print(map(chr,(0x4a,0x41,0x50,0x48,0xa)))'
      Nobody who groks /. uses it. They avoid it.
Re: I resolve to finally grok and use the regex option...
by bageler (Hermit) on Apr 27, 2005 at 05:58 UTC
    mexicogs: third world folk workin for the man.
Re: I resolve to finally grok and use the regex option...
by deprecated (Priest) on Apr 27, 2005 at 06:03 UTC
    There should be a damn /ee option to this poll.

    --
    Tilly is my hero.

View List Of Past Polls


Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2014-12-21 02:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (101 votes), past polls