Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save trycf/4c183cd6a254abb438994963969c1eda to your computer and use it in GitHub Desktop.
Save trycf/4c183cd6a254abb438994963969c1eda to your computer and use it in GitHub Desktop.
TryCF Gist
<cfset variables.calExp = '0/1 * 100'/>
<cfset dbz_patterns = ['/0','/ 0','/(0)','/ (0)'] />
<cfloop array="#dbz_patterns#" item="dbz_pattern">
<cfset variables.hasDivisionByZero = FindNoCase(dbz_pattern, variables.calExp) gt 0 />
<cfif variables.hasDivisionByZero>
<cfbreak />
</cfif>
</cfloop>
<cfoutput>
#variables.hasDivisionByZero#
</cfoutput>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment