Re: RFC 316 (v1) Regex modifier for support of chunk processing and prefix matching
[email protected] (Hugo) Fri, 29 Sep 2000 00:29:31 +0100
| Newsgroups | perl.perl6.language.regex |
|---|---|
| Message-ID | <[email protected]> |
In <[email protected]>, Perl6 RFC Librarian writes: :In addition, pos() is set to the offset of the start of the recognized :match prefix. In case of a plain succesful match, or of a normal :not-found termination, pos is undef() on exit. That's not entirely true - it depends on the flags. It is always true after a failed match though, which I think is enough for your intended behaviour. :This serves both as a flag, as pos will only be defined if the search :has been aborted for this reason, and it allows more optimized :searching, :because after you have appended the next chunk to the current one, the :next try will simply start again at the position where the pattern may :first match, skipping any earlier matches. Is that intended to be a feature of /z alone, or only in the presence of /g? Perhaps you could add an extra example or two showing how you might use /gcz or /z alone. :I originally had thought of providing a separate, dedicated regex :modifier, just for the match prefix, but I don't think too many people :need this that desperately. You can easily build a working application :with just the '/z' modifier. If you can't, you're in over your head, :anyway. ;-) I don't understand this paragraph. Hugo