Solved

Where can i find a IsAlphaNumeric UDF in ColdFusion

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

744 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now