Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Where can i find a IsAlphaNumeric UDF in ColdFusion

Posted on 2009-05-13
1
Medium Priority
?
277 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 1000 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

Understanding Web Applications

Without even knowing it, most of us are using web applications on a daily basis. Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We often confuse these web applications tools for websites.  So, what is the difference?

Question has a verified solution.

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

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…
Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

618 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