<cfwhat>

Thursday, September 24, 2009

Web Standards Curriculum

A great online course from Opera covering HTML, CSS, JavaScript and Web Standards.

Monday, September 21, 2009

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 &nbsp;)
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")