On Thu, Aug 19, 2010 at 03:42:27PM +0100, Zefram wrote: > Abigail wrote: > >written code that actually scans for (?xism:) constructs and modifies > >them. Such code would break if (?xism:) is going to be replaced with (?~:). > > Without (?^:) it's liable to break whenever new flags are added. Only if you're actually going to change the meaning of modifiers. I parsed for /\(\?([a-z]*)(-?)([a-z]*):/i, knowing that if modifiers were to be added, it would be ASCII letters. And then inspect and mangle $1 & $3. > > '(?si-xm:)' tells me exactly what's > >enabled, and what's disabled, regardless of the Perl version. > > No, it doesn't. It doesn't tell you whether the /p flag is enabled. It does. It tells me that pattern following the : neither enables, nor disables /p. Whether /p is in effect is inherited from the enclosing pattern. I can take '(?si-xm:PATTERN)', and know what it does by itself. Regardless of Perl version. If someone comes to me and ask what '(?si-xm:PATTERN)' means, I can explain it to him. If he comes with '(?~-xm:PATTERN)', I'll have to reply "well, that depends on the version of Perl you're running". AbigailThread Previous | Thread Next