Solved

Where can i find a IsAlphaNumeric UDF in ColdFusion

Posted on 2009-05-13
1
219 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Create the perfect environment for any meeting

You might have a modern environment with all sorts of high-tech equipment, but what makes it worthwhile is how you seamlessly bring together the presentation with audio, video and lighting. The ATEN Control System provides integrated control and system automation.

Question has a verified solution.

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

In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

749 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