Re: Regex syntax

2008-03-18 Thread Jon Lang
a different syntax from the long forms, and I personally like the current syntax for both. That said, all's fair if you predeclare: I could see someone creating a module that allows you to tweak the regex syntax in a manner similar to what you're proposing, if there's enough of a demand

Regex syntax

2008-03-13 Thread Moritz Lenz
I have two questions/suggestions regarding regex syntax: 1) The :ii modifier is influenced by :sigspace modifier. IMHO this is ugly, because the matching part and the replacement part of a regex should be as orthogonal as possible. Therefore I'd like a different syntax for :ii :sigspace, maybe

Re: Suggestion for perl 6 regex syntax

2002-09-09 Thread David Helgason
Yeay! Golf... Adam D. Lopresto wrote: [...golf...] /^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/ #50 chars [...more golf...] Of course, that's because we use perl6's strengths. :i/^(+|-)?(\d*[\.\d*]?)($2=~/./)[E([+|-]?\d+)]?$/ #51 Clever! But If we are allowed to use

Re: Suggestion for perl 6 regex syntax

2002-09-09 Thread Aaron Sherman
[Moved over from p6i, to more appropriate p6l] On Sat, 2002-09-07 at 12:03, Mr. Nobody wrote: While Apocolypse 5 raises some good points about problems with the old regex syntax, its new syntax is actually worse than in perl 5. Most regexes, such as this one to match a C float

Re: Suggestion for perl 6 regex syntax

2002-09-09 Thread Mark J. Reed
On Mon, Sep 09, 2002 at 05:02:18PM -0400, Aaron Sherman wrote: On Mon, 2002-09-09 at 06:05, David Helgason wrote: Yeay! Golf... If we are allowed to use all of perl6 in this particular (golf-)course, I suggest: Clearly I've missed a reference at some point. Presumably golf is used

Re: Suggestion for perl 6 regex syntax

2002-09-09 Thread Uri Guttman
AS == Aaron Sherman [EMAIL PROTECTED] writes: AS On Mon, 2002-09-09 at 06:05, David Helgason wrote: Yeay! Golf... If we are allowed to use all of perl6 in this particular (golf-)course, I suggest: AS Clearly I've missed a reference at some point. Presumably golf AS is used

Re: Suggestion for perl 6 regex syntax

2002-09-08 Thread Adam D. Lopresto
the new perl6 code actually shorter than the (correct) perl5 version. Of course, that's because we use perl6's strengths. :i/^(+|-)?(\d*[\.\d*]?)($2=~/./)[E([+|-]?\d+)]?$/#51 While Apocolypse 5 raises some good points about problems with the old regex syntax, its new syntax is actually

Suggestion for perl 6 regex syntax

2002-09-07 Thread Mr. Nobody
While Apocolypse 5 raises some good points about problems with the old regex syntax, its new syntax is actually worse than in perl 5. Most regexes, such as this one to match a C float /^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/ would actually become longer: /^([+-]?)before \d|\.\d\d

Re: Suggestion for perl 6 regex syntax

2002-09-07 Thread Ken Fox
in this case, but it's a good general rule -- and you're making generalizations about regex syntax.) /^sign?before \d|\.\d\d*[\.\d*]?[:i esign?\d+]?$/ I'd put in some white space to clarify the different logical pieces of the rule: /^ sign? before \d | \.\d \d* [\.\d*]? [:i e sign? \d+]? $/ Now

Re: Suggestion for perl 6 regex syntax

2002-09-07 Thread Luke Palmer
On Fri, 6 Sep 2002, Mr. Nobody wrote: While Apocolypse 5 raises some good points about problems with the old regex syntax, its new syntax is actually worse than in perl 5. Most regexes, such as this one to match a C float /^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/ would actually

Re: Some regex syntax foibles

2002-07-02 Thread Allison Randal
code to get a return value (which is more what we would expect from a block than just getting a truth value). Think of it as analogous to C $pat , only the value of $pat is returned instead of pre-existing within a variable. And, C $( code ) fits nicely with the general (non-regex) syntax

Re: Some regex syntax foibles

2002-07-02 Thread Allison Randal
On Tue, Jul 02, 2002 at 03:59:57PM -0500, Allison Randal wrote: The parens in #3, C ( code ) , make sense if you think of s/3/2/ Allison

Some regex syntax foibles

2002-07-01 Thread Me
Current p6 rx syntax aiui regarding embedded code: / #1 do (may include an explicit fail): { code } #2 do with implicit 'or fail' ( code ) #3 interp lit: $( { code } ) #4 interp as rx: { code } / This feels cryptic. Do we need abbreviated syntax for

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 /$var

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

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

2000-08-24 Thread Tom Christiansen
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. If I recall correctly, the Python folks addressed this. One might check

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. Thanks.

Redesigning regex syntax (Was: Re: RFC for recursive regexps)

2000-08-03 Thread Johan Vromans
Damian Conway [EMAIL PROTECTED] writes: Of course, that example might in itself be sufficient reason to completely redesign the regex syntax! Perl uses the term "pattern matching" since day one. This opens the possibility of extending pattern matching with other, not neccessarily r