in reply to (Regex Golf) Re: Matching floats according to perlfaq4
in thread Matching floats according to perlfaq4

I like your modification of the FAQ version, but id prefer to write it as
/^[+-]?(?=\.?\d)\d*(?:\.\d*)?(?:[Ee][+-]?\d+)?$/
As it makes more sense to me and I dont like the /i modifier. (Also I dont see any reason to capture the last block if you arent going to capture the others... :-)

Although im aware you were trying to make the regex shorter... Personally I wouldn't.

--- demerphq
my friends call me, usually because I'm late....

Replies are listed 'Best First'.
Re: Re: (Regex Golf) Re: Matching floats according to perlfaq4
by sauoq (Abbot) on Sep 27, 2002 at 15:56 UTC

    Thanks. To be clear, I prefer that one too. I wasn't even trying to make a shorter version, just a simpler version.

    The only reason I put that one up was because I had already prefixed "(Regex Golf)" to the node after I noticed mine was shorter than the ones in the OP but then later realized that the Anonymonk's was shorter than mine due to his ugly little tricks. So, in a moment of poor judgement, I showed that I could use those ugly little tricks too. :-)

    -sauoq
    "My two cents aren't worth a dime.";