These are the valid characters of SWIFT: " a-zA-Z0-9,.:'\+\(\)\?'\-/" (exclude the double quotes - just wanted to show the space). How do I construct a regular expression to remove all OTHER text except the above from a string. I'm using ColdFusion but I don't think this is a cold fusion question it is more a reg-ex question (of which I am quite green). This is what I have for my search string !([ a-zA-Z0-9,.:'\+\(\)\?'\-/]). I'm trying to figure what I am doing wrong. This is what I have: <cfset Valids = "!([ a-zA-Z0-9,.:'\+\(\)\?'\-/])"> <cfset CleanString = ReReplace(Arguments.DirtyString,Valids,"","ALL")> What "I THINK" I am saying is replace all characters that are not in the list of Valid Chars with an empty string. Any help would be appreciated. Thanks!!
Excellent - thanks! PS: I've been working on that for 9 days now - lol. Have any resources that I can go to that teaches reg-ex???? Thanks again!!!
Here at home I only have 3 links bookmarked, I have more at work. I'll post them tomorrow if I remember. http://www.programmingtalk.com/showthread.php?t=21391 http://weblogtoolscollection.com/regex/regex.php http://regexlib.com/CheatSheet.aspx
By the way, I don't know if the expressions change in CF, but in PHP you have to escape the dot, cause it stands for any character. I added the escape slash. Remove it if it needs to be removed in CF...