Re: Perl 5's "non-greedy" matching can be TOO greedy!

2000-12-15 Thread Kevin Walker
I wrote: >More generally, it seems to me that you're hung up on the >description of "*?" as "shortest possible match". That's an >ambiguous simplification of what "*?" means. It might better be >described as "match until you find a match for the rest of the >regex" ('d' in your example). I

Re: Perl 5's "non-greedy" matching can be TOO greedy!

2000-12-15 Thread Kevin Walker
"Deven T. Corzine" <[EMAIL PROTECTED]> writes: >I've yet to see a concrete example of where the current behavior is >helpful, What about matching C comments? ($first_comment) = $code =~ m!(/\*.*?\*/)!s; # (ignore issues with quoted strings in $code Works correctly under the curre

Regex Extension RFC

2000-09-30 Thread Kevin Walker
=head1 TITLE Allow multiply matched groups in regexes to return a listref of all matches =head1 VERSION Maintainer: Kevin Walker <[EMAIL PROTECTED]> Date: 30 Sep 2000 Version: 1 Mailing List: [EMAIL PROTECTED] Status: Frozen =head1 DESCRIPTION Since the October 1 RFC de

RFC 150

2000-09-30 Thread Kevin Walker
=head1 TITLE Extend regex syntax to provide for return of a hash of matched subpatterns =head1 VERSION Maintainer: Kevin Walker <[EMAIL PROTECTED]> Date: 23 Aug 2000 Mailing List: [EMAIL PROTECTED] Number: 150 Version: 2 Status: Frozen =head1 ABSTRACT Currently r

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

2000-09-13 Thread Kevin Walker
>Thinking about the comparision between the two RFCs there is some common >ground, but cases where people will want your hash and cases where >people will want explicit variables. Using RFC 112, you can do >hash assignment, but it would not clear the hash beforehand whereas >your hash assignment

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

2000-09-08 Thread Kevin Walker
(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 example, you can't now safely say > >/$v

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

2000-08-24 Thread Kevin Walker
At 11:23 AM -0600 on 8/24/00, Tom Christiansen wrote: >This is useful in that it would stop being number dependent. >For example, you can't now safely say > >/$var (foo) \1/ > >and guarantee for arbitrary contents of $var that your you have >the right number backref anymore. Good point. Tha

Re: RFC 145 (v1) Brace-matching for Perl Regular Expressions

2000-08-24 Thread Kevin Walker
At 12:13 PM -0400 on 8/24/00, Mark-Jason Dominus wrote: >The big problem I see that you didn't address is that you didn't say >what would happen when the target string contains mismatched >parentheses. > >Your example was: > >$string = "([b - (a + 1)] * 7)"; >$string =~ /\g.*?\G/; > >Now

Re: RFC 143 (v1) Case ignoring eq and cmp operators

2000-08-24 Thread Kevin Walker
>Perl currently only has C and C operators which work >case-sensitively. >It would be a useful addition to add case-insensitive equivalents. I think this is an excellent idea. I personally would find it very useful. > $a eq/i $b > $a cmp/i $b > >This still leaves some room for future additi

Re: RFC 112 (v1) Assignment within a regex

2000-08-17 Thread Kevin Walker
I think hash assignment within regex's would be more useful than variable assignment (though there's no reason there couldn't be both, I suppose). Here's a copy of something I sent to p5p a while back: I suggest that (?%field_name: pattern) spit out 'field_name', in addition to the matched p