/m, /s: better mnemonic than "multiple", "single"?

Discussion in 'Perl Misc' started by J Krugman, May 19, 2004.

  1. J Krugman

    J Krugman Guest

    For the life of me, I can never remember what the /m and /s regexp
    modifiers mean. I know that "s" stands for "single line" and "m"
    stands for "multiple lines", but this is of no help: I still have
    to look up what that "single" and "multiple" means as far as the
    modified regexp's behavior.

    TIA,

    jill
    --
    To s&e^n]d me m~a}i]l r%e*m?o\v[e bit from my a|d)d:r{e:s]s.
     
    J Krugman, May 19, 2004
    #1
    1. Advertising

  2. >>>>> "J" == J Krugman <> writes:

    J> For the life of me, I can never remember what the /m and /s regexp
    J> modifiers mean. I know that "s" stands for "single line" and "m"
    J> stands for "multiple lines", but this is of no help: I still have
    J> to look up what that "single" and "multiple" means as far as the
    J> modified regexp's behavior.

    I just call them the "s and m options".

    :)

    print "Just another Perl hacker,"; # the original

    --
    Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
    <> <URL:http://www.stonehenge.com/merlyn/>
    Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
    See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
     
    Randal L. Schwartz, May 19, 2004
    #2
    1. Advertising

  3. J Krugman

    Ben Morrow Guest

    Quoth J Krugman <>:
    >
    > For the life of me, I can never remember what the /m and /s regexp
    > modifiers mean. I know that "s" stands for "single line" and "m"
    > stands for "multiple lines", but this is of no help: I still have
    > to look up what that "single" and "multiple" means as far as the
    > modified regexp's behavior.


    /s affects a single metacharacter, '.'.
    /m affects multiple metacharaters, '^' and '$'.

    Ben

    --
    We do not stop playing because we grow old;
    we grow old because we stop playing.
     
    Ben Morrow, May 19, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Peter Bencsik
    Replies:
    2
    Views:
    878
  2. mnemonic

    , Nov 1, 2007, in forum: C Programming
    Replies:
    83
    Views:
    2,690
    Charlie Gordon
    Nov 7, 2007
  3. jacob navia

    Mnemonic

    jacob navia, Nov 3, 2007, in forum: C Programming
    Replies:
    40
    Views:
    1,583
    Mark McIntyre
    Nov 10, 2007
  4. subwiz
    Replies:
    1
    Views:
    351
    John B. Matthews
    Sep 19, 2008
  5. Replies:
    2
    Views:
    67
    Mark H Harris
    May 13, 2014
Loading...

Share This Page