Re: RFC 145 (alternate approach)
[email protected] (Richard Proctor) Tue, 5 Sep 2000 21:20:36 +0100 (BST)
| Newsgroups | perl.perl6.language.regex |
|---|---|
| Message-ID | <[email protected]> |
On Tue 05 Sep, Nathan Wiger wrote:
> Eric Roode wrote:
> Now *that* sounds cool, I like it!
>
> What if the RFC only suggested the addition of two new constructs, (?[)
> and (?]), which did nested matches. The rest would be bound by standard
> regex constructs and your imagination!
>
> That is, the ?] simply takes whatever the closest ?[ matched and
> reverses it, verbatim, including ordering, case, and number of
> characters. The only trick would be a way to get what "reverses it"
> means correct.
>
No ?] should match the closest ?[ it should nest the ?[s bound by any
brackets in the regex and act accordingly.
Also this does not work as a definition of simple bracket matching as you
need ( to match ) not ( to match (. A ?[ list should specify for each
element what the matching element is perhaps
(?[( => ),{ => }, 01 => 10)
sort of hashish in style.
Perhaps the brackets could be defined as a hash allowing (?[%Hash)
Richard
--
[email protected]