For Programmers: Free Programming Magazines  


Home > Archive > PERL Miscellaneous > May 2004 > /m, /s: better mnemonic than "multiple", "single"?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

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

2004-05-19, 12:32 pm




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.

Randal L. Schwartz

2004-05-19, 2:31 pm

>>>>> "J" == J Krugman <jkrugman345@yahbitoo.com> 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
<merlyn@stonehenge.com> <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!
Ben Morrow

2004-05-19, 4:31 pm


Quoth J Krugman <jkrugman345@yahbitoo.com>:
>
> 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.me.uk
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com