REMatch (ColdFusion)
Thursday, February 1st, 2007 • Related • Filed Under
Following are some UDFs I wrote recently to make using regexes in ColdFusion a bit easier. The biggest deal here is my reMatch() function.
reMatch(), in its most basic usage, is similar to JavaScript's String.prototype.match() method. Compare getting the first number in a string using reMatch() vs. built-in ColdFusion functions:
reMatch:
<cfset num = reMatch("\d+", string) />
reReplace:
<cfset num [...]
