Re: RFC 145 (alternate approach)

2000-09-06 Thread Richard Proctor
On Tue 05 Sep, Nathan Wiger wrote: "normal" "reversed" -- --- 103301 99aa99 (( )) + + {{[!_ _!]}} {__A1( )A1__} That is, when a bracket is encountered, the "reverse" of

Re: RFC 145 (alternate approach)

2000-09-05 Thread Richard Proctor
On Tue 05 Sep, David Corbin wrote: Nathan Wiger wrote: But, how about a new ?m operator? /(?m|[).*?(?M|])/; Let's combine yor operator with my example from above where everything inside the (?m) or the ?(M) fits the syntax of a RE. /(?m()|\[).*?(?M()|(\]))

Re: XML/HTML-specific ? and ? operators? (was Re: RFC 145 (alternate approach))

2000-09-07 Thread Richard Proctor
On Wed 06 Sep, Mark-Jason Dominus wrote: I've been thinking the same thing. It seems to me that the attempts to shoehorn parsers into regex syntax have either been unsuccessful (yielding an underpowered extension) or illegible or both. SNOBOL: parenstring = '(' *parenstring ')'

Re: RFC 150 (v1) Extend regex syntax to provide for return of a hash of matched subpatterns

2000-09-08 Thread Richard Proctor
On Fri 08 Sep, Kevin Walker wrote: (This thread has been inactive for a while. See http://www.mail-archive.com/perl6-language-regex@perl.org/index.html#0 0015 for it's short history.) Long ago Tom Christiansen wrote: This is useful in that it would stop being number dependent. For

RFC 110 counting matches (post Hugo)

2000-09-11 Thread Richard Proctor
This list has gone a little quiet... Hugo wrote: I like this too. I'd suggest /t should mean a) return a scalar of the number of matches and b) don't set any special variables. Then /t without /g would return 0 or 1, but be faster since no extra information need be captured (except

RFC 166 (postHugo)

2000-09-11 Thread Richard Proctor
This RFC had three concepts, I propose dropping the "Not a pattern" from here as it is now in RFC 198 and the null element. The List expansion might benefit from a slight enhancement. Hugo: (?@foo) and (?Q@foo) are both things I've wanted before now. I'm not sure if this is the right syntax,

Re: RFC 166 (v1) Additions to regexs

2000-09-12 Thread Richard Proctor
On Mon 11 Sep, Mark-Jason Dominus wrote: (?@foo) is sort of equivalent to (??{join('|',@foo)}), ie it expands into a list of alternatives. One could possible use just @foo, for this. It just occurs to me that this is already possible. I've written a module, 'atq', such that if you

Generalised Additions to regexes

2000-09-12 Thread Richard Proctor
(proto RFC possibly, and some generalised ramblings) Given that expansion of regexes could include (+...) and (*...) I have been thinking about providing a general purpose way of adding functionality. I propose that the entire (+...) syntax is kept free from formal specification for this and

Re: RFC 166 (v1) Additions to regexs

2000-09-13 Thread Richard Proctor
On Wed 13 Sep, Bart Lateur wrote: On Tue, 12 Sep 2000 19:01:35 -0400, Mark-Jason Dominus wrote: I don't know what you mean, but you're mistaken, because it means to interpolate @foo as in a double-quoted string. Which is precisely the meaning he wants for it, with $" set to '|'. I

Perlstorm #0040

2000-09-23 Thread Richard Proctor
TomCs perl storm has: Figure out way to do /$e1 $e2/ safely, where $e1 might have '(foo) \1' in it. and $e2 might have '(bar) \1' in it. Those won't work. If e1 and e2 are qr// type things the answer might be to localise the backref numbers in each qr// expression. If they

Re: Perlstorm #0040

2000-09-24 Thread Richard Proctor
On Sun 24 Sep, Hugo wrote: In [EMAIL PROTECTED], Richard Proctor writes : :TomCs perl storm has: : : Figure out way to do : : /$e1 $e2/ : : safely, where $e1 might have '(foo) \1' in it. : and $e2 might have '(bar) \1' in it. Those won't work. : :If e1 and e2 are qr// type

Re: RFC 198 (v2) Boolean Regexes

2000-09-27 Thread Richard Proctor
HI Tom, Welcome to England (I presume) This seems very complicated. Did you look at the Ram:6 recipe on expressing AND, OR, and NOT in a regex? For example, to do /FOO/ /BAR/ you need not write /FOO.*BAR|BAR.*FOO/ -- and in fact, should not, as it doesn't work properly on some pairs!

Re: is \1 vs $1 a necessary distinction?

2000-09-27 Thread Richard Proctor
On Wed 27 Sep, Dave Storrs wrote: On Wed, 27 Sep 2000, Richard Proctor wrote: Both \1 and $1 refer to what is matched by the first set of parens in a regex. AFAIK, the only difference between these two notation is that \1 is used within the regex itself and $1 is used outside

Re: RFC 112 (v3) Asignment within a regex

2000-09-29 Thread Richard Proctor
On Fri, 29 Sep 2000 01:02:40 +0100, Hugo wrote: It also isn't clear what parts of the expression are interpolated at compile time; what should the following leave in %foo? %foo = (); $bar = "one"; "twothree" =~ / (?$bar=two) (?$foo{$bar}=three) /x; It's not just that. You act