what about negative numbers? eg (-213)

> -----Original Message-----
> From: Paul Johnston [mailto:[EMAIL PROTECTED]]
> Sent: 12 February 2003 17:29
> To: [EMAIL PROTECTED]
> 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