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

J

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.

TIA,

jill
 
R

Randal L. Schwartz

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
 
B

Ben Morrow

Quoth J Krugman said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top