latest reactions

David Levin
Does the trim still work if the form fie …
mal
as long as the join keys are same in eac …
Tarida
I am using ipinfodb.com to redirect the…
David Levin
Good stuff. For those interested in a UD …
PtcBux
oh Wilbur Gans wrote thank you so much…

Clicky Web Analytics
Use OpenDNS
ZERIGO DNS

Ultimate dns hosting based on pre-defined templates, DNS redirection and lot's more.

mxna feeds

Video : Security improvements in ColdFusion 10Adobe ColdFusion Webcast: Evolutions of ColdFusion and Application Predictions for 2013Resolve Stability Problems and SPEED UP ColdFusion 10Strange Interaction Between DeserializeJson(), ArrayContains(), And Database Values In ColdFusionNot able to apply Hotfix from ColdFusion 10 Administrator on Windows with Lockdown guide imposed on server. How to setInfinite Scroll Example with ColdFusionColdFusion Summit 2013ColdFusion Dev Needed: Albany, NYCF911: New Adobe document about #ColdFusion security hotfixes: required reading, I'd sayColdFusion Summit AnnouncedAdobe Announces ColdFusion Summit 2013Circular Thumbnails with ColdFusion / CSSColdFusion Dev needed: South FloridaeBay Looking for a ColdFusion DeveloperFace Cropped Thumbnails with ColdFusion

All files are strictly confidential: all information is classified.
© Copyright 2002 - 2013 mximize.com.
All right reserved.

Visit Carlos GallupaMXNA webfeed

Strip unwanted characters from a string

Strip all except numbers and letters

<cfset newstr = rereplace(str, "[^A-Za-z0-9]+", "", "all")>

Strip all except numbers

<cfset newstr = rereplace(str, "[^0-9]+", "", "all")>


Strip all except CAPITAL letters

<cfset newstr = rereplace(str, "[^A-Z]+", "", "all")>

You get the point, this post is just for my own records. I keep forgetting how to do this and now I can look it up on my own blog.. thank god for that!!

18983 viewed | 7 opinion(s)  | del.icio.us | Digg it | Tjarko @ 15/01/07 21:39 cet


Reactions:

nwel wrote.... (mail)

this code saved my ass..
thanks a lot.!
iloveyou!

26 February 2007 6:16 cet  

Ash wrote....

Thanks!Saved my ass, too!

14 March 2008 4:19 cet  

Andrew wrote....

Thanks for the tip. It's a real timesaver! :)

22 August 2008 20:31 cet  

khurram wrote.... (site)

Good one... Gonna use

02 October 2009 3:19 cet  

Lynn wrote.... (site)

I taught myself Cold Fusion (basics mimicking SQL) 10 years ago.Can I use this on the output?The second page that returns the data? Trying to avoid cleaning data already in database. Need to take out a single quote in names that messes up the other code on the results page.

Thanks

07 January 2011 19:18 cet  

Salvi Pascual wrote.... (site)

Thanks for sharing that code, it comes to save me in a rush last minute software delivery :) with errors :(

23 February 2012 15:34 cet  

Link Worx Seo wrote.... (site)

Hey, this was really helpful. Was trying to strip all characters from a string and replace it with dashes for naming directories when a directory is created or when a new page is created. Glad I searched the right thing. Google

08 March 2012 21:29 cet  

Leave your comment

Your name


Your url/website/link/email....


Some room for your reaction is placed here..



The answer to the ultimate question is?? (42 ;-))




URL en mail addresses are translated for you... life sometimes is that simple!!