Re: Regex syntax

2008-03-18 Thread Jon Lang
on this list some time ago. However, s/.../../ is still valid. I'm not in favor of the so-called "short forms" having 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 so

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,

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

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 "

Re: Suggestion for perl 6 regex syntax

2002-09-09 Thread Aaron Sherman
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 here to mean something like "stupid question". > Perl6 will be a

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

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

Re: Suggestion for perl 6 regex syntax

2002-09-08 Thread Adam D. Lopresto
antissa isn't empty, making 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 proble

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+

Re: Suggestion for perl 6 regex syntax

2002-09-07 Thread Ken Fox
agments to use a sub-rule because repeated constants make things harder to read. (Not so bad in this case, but it's a good general rule -- and you're making generalizations about regex syntax.) /^?\d*[\.\d*]?[:i e?\d+]?$/ I'd put in some white space to clarify the different logi

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: /^(<[+-]>?)\d*(\.\d*)

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

Re: Some regex syntax foibles

2002-07-02 Thread Allison Randal
re 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 for interpolating a scalar expression. 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

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,