Solved

Where can i find a IsAlphaNumeric UDF in ColdFusion

Posted on 2009-05-13
1
214 Views
Last Modified: 2013-12-24
I am looking for a function in CFScript that can check whether or not a string is alphanumeric or not.  Could anyone help me?
0
Comment
Question by:onaled777
1 Comment
 
LVL 52

Accepted Solution

by:
_agx_ earned 250 total points
ID: 24376723
You can use a regular expression like:

      <cfset foundAt = reFind("[^0-9a-zA-z]", string)>
       ... OR
       <cfset foundAt = reFind("[\W]", string)>  


Example
<cfset string = "!absdfsdfsdfsdfsdf3213">
<cfset foundAt = reFind("[^0-9a-zA-z]", string)>
<cfif foundAt eq 0>
	AlphaNumeric
<cfelse>
	Non-AlphaNumeric characters detected
</cfif>

Open in new window

0

Featured Post

Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question