> ( examples with appended quantifiers )
Not really.
perlre is actually quite explicit about the why
> > > The caret tells Perl that this cluster doesn't inherit the flags of any surrounding pattern, but uses the system defaults (d-imnsx ), modified by any flags specified.
In other words: It's about preserving the flags of the embedded regex and assuming default if none are specified.
DB<7> $U=qr/U/ # always upper case DB<8> $i=qr/i${U}i/i # surrounding case insensitive DB<9> p $i (?^ui:i(?^u:U)i) DB<10> p 'iui' =~ $i DB<11> p 'iUi' =~ $i 1 DB<12> p 'IUI' =~ $i 1 DB<13> p 'IuI' =~ $i DB<14> p join "\n", grep { $_ =~ $i } <{i,I}{u,U}{i,I}> iUi iUI IUi IUI
Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Wikisyntax for the Monastery
In reply to Re^2: Tidying and simplifying a regular expression (flags)
by LanX
in thread Tidying and simplifying a regular expression
by Dallaylaen
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |