Utility Function: PatternFind()
- December 13, 2008 5:29 AM
- Utility Function
- Comments (0)
Another pattern based function.
<cffunction name="PatternFind" output="false" returntype="boolean">
<cfargument name="pattern" type="string" required="true" />
<cfargument name="string" type="string" required="true" />
<cfset var local = StructNew() />
<cfif IsSimpleValue(arguments.pattern)>
<cfset arguments.pattern = CreateObject("java", "java.util.regex.Pattern").compile(arguments.pattern) />
</cfif>
<cfset local.matcher = arguments.pattern.matcher(arguments.string) >
<cfreturn local.matcher.find() />
</cffunction>