in reply to Re: Just a regex quickie
in thread Just a regex quickie

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: Re: Re: Just a regex quickie
by dragonchild (Archbishop) on Jun 02, 2004 at 15:29 UTC
    I was hoping that by breaking the problem into its component parts, you'd figure out where you went wrong on your own.

    cmp is for ascii comparisons. <=> is for numeric comparisons. (A number, for reference, is generally (thought not exhaustively) defined as matching /^-?(?:\d+(?:\.\d*))|(?:\.\d+)$/.)

    Your regex is pulling characters that match (roughly) /[a-zA-Z_0-9\s]/. (I'm sure I missed a few characters that match \w.)

    Do you see the issue now?

    ------
    We are the carpenters and bricklayers of the Information Age.

    Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose

    I shouldn't have to say this, but any code, unless otherwise stated, is untested

    A reply falls below the community's threshold of quality. You may see it by logging in.