ColdFusion 8 and Java Regex Tester

This is a regular expression tester for ColdFusion. CF doesn't support all of the expressions you might find listed at sites like http://www.regular-expressions.info/, so I built this tester to help me check what it does support and how it matches values.

ColdFusion 8 Tester

This code uses just the plain REFind function:

<cfset regexResult = REFind(expression, data, 1, true) />

Although I've found no differences in RegEx between CF7 and CF8, you might want to double check if these expressions are being used on a CF7 server.

Test Data:
Expression 1:
Expression 2:
Expression 3:
Expression 4:
Expression 5:

Java Tester

This code uses instances of java.util.regex.Pattern, like the following:

java.util.regex.Pattern p = java.util.regex.Pattern.compile("a*b");
java.util.regex.Matcher m = p.matcher("aaaaab");
boolean b = m.matches();

The Java Regex engine seems to be very different from the CF engine, which I think is really interesting.

Test Data:
Expression 1:
Expression 2:
Expression 3:
Expression 4:
Expression 5:





Jon Hartmann, July 2011

I'm Jon Hartmann and I'm a Javascript fanatic, UX/UI evangelist and former ColdFusion master. I blog about mysterious error messages, user interface design questions, and all things baffling and irksome about programming for the web.

Learn more about me on LinkedIn.