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
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
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
[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
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
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
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
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
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
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
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
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
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
(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
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
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
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.
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
18 matches
Mail list logo