Posted By

Scooter on 07/19/08


Tagged

regular expressions


Versions (?)


Advertising

Website Promotion DIRECTORY is a crucial factor for all websites that need to gain better organic search engine rankings and increase website traffic.
Submitting your website as part of your Web Promotion strategy to our SEO friendly and high traffic Business Directory for review is an excellent way to gain a valuable backlink and increase your websites visibility online.

Submit Site


Who likes this?

1 person has marked this snippet as a favorite

benrudolph


isAlphaNumeric


Published in: ASP 






URL: http://reusablecode.blogspot.com/2008/07/isalphanumeric.html

Expand | Embed | Plain Text
  1. <%
  2. ' Copyright (c) 2008, www.thecanonman.com; some rights reserved.
  3. '
  4. ' This work is licensed under the Creative Commons Attribution License. To view
  5. ' a copy of this license, visit http://creativecommons.org/licenses/by/3.0/ or
  6. ' send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California
  7. ' 94305, USA.
  8.  
  9. ' Checks if a string contains only alphanumeric characters.
  10. function isAlphaNumeric(someString)
  11. dim regEx
  12.  
  13. set regEx = new RegExp
  14.  
  15. with regEx
  16. .Global = true
  17. .IgnoreCase = true
  18. .Pattern = "[\w\s.]"
  19. end with
  20.  
  21. if regEx.test(someString) then
  22. isAlphaNumeric = true
  23. else
  24. isAlphaNumeric = false
  25. end if
  26.  
  27. set regEx = nothing
  28. end function
  29. %>

Report this snippet 

You need to login to post a comment.