RESwitch / RECase ColdFusion Custom Tags For Regular Expression Switch Statements

<!--- Check to see which tag mode we are in. --->
<cfif (THISTAG.ExecutionMode EQ "Start")>
 
	<!--- Start mode. --->
 
	<!--- Check to make sure this tag has an end tag. --->
	<cfif NOT THISTAG.HasEndTag>
 
		<cfthrow
			type="RESwitch.MissingEndTag"
			message="This RESwitch tag requires an end tag."
			/>
 
	</cfif>
 
 
	<!--- Param tag attributes. --->
 
	<!---
		This is the expression that we are testing (the value
		against which we are going to try and match our patterns).
	--->
	<cfparam
		name="ATTRIBUTES.Expression"
		type="string"
		/>
 
 
	<!---
		Set the match flag to indicate whether or not any of the
		child tags has successfully matched a tag.
	--->
	<cfset VARIABLES.IsPatternMatched = false />
 
 
	<!---
		Create a Pattern object that we can use to compile our
		patterns in the child tags.
	--->
	<cfset VARIABLES.PatternClass = CreateObject(
		"java",
		"java.util.regex.Pattern"
		) />
 
<cfelse>
 
	<!--- End mode. --->
 
</cfif>

For Cut-and-Paste