$s = "foo\nfoot\nroot"; $s =~ /^foo/g; # matches only the first foo $s =~ /^foo/gm; # matches both foo $s =~ /f.*t/g; # matches only foot $s =~ /f.*t/gs; # matches foo\nfoot\nroot $s =~ /f.*?t/gs; # matches foo\nfoot $s =~ /^foot.*root$/g; # doesn't match $s =~ /^foot.*root$/gm; # doesn't match $s =~ /^foot.*root$/gs; # doesn't match $s =~ /^foot.*root$/gms; # matches foot\nroot
In reply to Re: example of 'm / / m' related example and compare to 'm / / s'
by Stamm
in thread PERL regex modifiers for m//
by rockstar99
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |