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
In reply to Re: Re: Re: Just a regex quickie
by dragonchild
in thread Just a regex quickie
by pseudosocrates
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |