Regular Expression tester - ColdFusion

I stumbled upon some code I had written back in September, for testing regular expressions. This uses ColdFusion, and is currently 'running' on ColdFusion MX 6.1 and ColdFusion 7.0.

It's a pity to not make it available, since it's such an easy template ...

<!--- --- ---
DESCRIPTION:
	 Basic way to test a regular expression.

CALLED BY: ???

CALLS: ???

ASSUMPTIONS: ???

MODIFICATION HISTORY: DATE USER ACTION 09/24/2007 J.Skemp Created template.

— — —>

<style type=“text/css”> form { margin:0; padding:0; } form label, .label_kludge { display:block; float:left; width:180px; padding:0; margin:5px 0 0; text-align:right; } form input, form textarea, form select { width:200px; margin:5px 0 0 10px; } textarea { overflow:auto; } form br { clear:left; } </style>

<cfparam name=“RegularExpression” default="" /> <cfparam name=“TestString” default="" /> <cfparam name=“CaseSensitive” default=“off” />

<h1>The great regular expression testing solution</h1> <cfform> <label for=“RegularExpression”>Regular Expression:</label><cfinput type=“text” name=“RegularExpression” style=“width:350px;” value="#RegularExpression#" /><br /> <label for=“TestString”>Test String:</label><cfinput type=“text” name=“TestString” style=“width:350px;” value="#TestString#" /><br /> <label for=“CaseSensitive”>Case Sensitive:</label><input type=“checkbox” name=“CaseSensitive” <cfif CaseSensitive EQ “on”>checked=“checked”</cfif> /><br /> <span class=“label_kludge”> </span><input type=“submit” value=“Test” /> </cfform>

<cfif RegularExpression NEQ "" AND TestString NEQ “"> <cfif CaseSensitive EQ “on”> <cfset FindText = REFind(RegularExpression, TestString) /> <cfelse> <cfset FindText = REFindNoCase(RegularExpression, TestString) /> </cfif> <p>Result: <cfif FindText EQ 0><strong>no</strong> </cfif>match found</p> </cfif>

Updates

May 4, 2008: Corrected a simple label error.