Solved

Where can i find a IsAlphaNumeric UDF in ColdFusion

Posted on 2009-05-13
1
225 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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
WAMP server installation, getting error popups, DLLs missing 5 90
Intranet and Kerberos Authentication (not sharepoint!) 8 176
Link failure 16 90
Problem to copy file 14 89
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.
What You Need to Know when Searching for a Webhost Provider
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

734 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