Paul,

If you want to be pedantic about it, you don't even need the ( )'s in
there... ;o)

[^.,-|0-9|] Will do the trick and cope with negative numbers.

Stephen



----- Original Message -----
From: "Paul Johnston" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, February 12, 2003 5:28 PM
Subject: RE: [ cf-dev ] brain fluff


Okay okay...

> >
> > CF is typeless, but not that typeless!  A number with a comma
> > or currency sign is a string, not a number.
> >
> > Care of Taz :
> > <cfset MyNumber = ReReplace(MyNumberAsAString,
> > '[^\.|0-9]{0,}', '', 'ALL')>

Badly written regex... Should be:

'[^(.|0-9)]'

This says find anything that IS NOT a "." or a number and replace it with ""
(nothing).

The () make it more readable, the backslash isn't needed inside [] to escape
the . and the {0,} is the same as saying * (which because you are replacing
with nothing is entirely unnecessary)!

Just thought I'd let you all know!

Paul




--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]




-- 
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]

Reply via email to