Useful regular expressions
Strip all HTML tags
REReplace(content,"<[^>]*>","","all")
Strip high ASCII characters (ASCII 128 and above)
REReplace(content,"[^\x00-\x7F]","","all")
Encode all ampersands that are not already encoded
REReplaceNoCase(content, "&(?!amp;)", "&", "all")
Encode all ampersands that are not part of entities
(eg. ignore )
REReplace(arguments.content, "&(?!##?\w+;)", "&", "all")
Validate a list of numbers
REReplace(content,"[^0-9,]","","all")
Strip new lines, carriage returns and tabs
REReplace(content,"[\n\r\t]","","all")
REReplace(content,"<[^>]*>","","all")
Strip high ASCII characters (ASCII 128 and above)
REReplace(content,"[^\x00-\x7F]","","all")
Encode all ampersands that are not already encoded
REReplaceNoCase(content, "&(?!amp;)", "&", "all")
Encode all ampersands that are not part of entities
(eg. ignore )
REReplace(arguments.content, "&(?!##?\w+;)", "&", "all")
Validate a list of numbers
REReplace(content,"[^0-9,]","","all")
Strip new lines, carriage returns and tabs
REReplace(content,"[\n\r\t]","","all")

0 Comments:
Post a Comment
<< Home