in reply to Must use regex, how to clip...
I'm not getting access to the real match operator (m//) so I cannot supply any optionsOh yes you can. There's a way to provide options inside the regex, even for only part of the regex, by putting them between the question mark and the colon in a (?:PAT) (non-capturing parens) construct. For example, these are equivalent:
For automatic help on the syntax, try print out a qr// pattern with whatever options you like./.*/si /(?si:.*)/
print qr/.*/si
As you can see, there are even more possibilities using this syntax: you can locally disable certain options, even if they're globally set for the whole regex, by putting a "-" in front of the list of options you want disabled. See also perlre.(?si-xm:.*)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Must use regex, how to clip...
by chantstophacking (Acolyte) on Jan 11, 2003 at 00:41 UTC |