I currently have a coldfusion regex that checks whether a string is alphanumeric or not.
I would like to open that up a bit more to allow period and underscore characters. How would I modify this to allow that?
<cfset isValid= true/>
<cfif REFind("[^[:alnum:]]", arguments.stringToCheck, 1) GT 0>
<cfset isValid= false />
</cfif>
Thanks
This should do it.
Also using “isValid” for a variable name is not a great practice. It is the name of a function in ColdFusion and could cause you issues someday.