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
Some regexpes will be longer, but a lot will benefit from the changes, by being
shorter or clearer, or often, both. The problem with your suggestion is you're
making assumeptions about what's common and what's not (character classes more
common than closures, for instance) that probably aren't
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
Mr. Nobody wrote:
/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/
would actually become longer:
/^([+-]?)before \d|\.\d\d*(\.\d*)?([Ee]([+-]?\d+))?$/
Your first expression uses capturing parens, but the captures
don't bind anything useful, so you should probably compare
non-capturing
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