Manufacturing Information Solutions Forum Index Manufacturing Information Solutions
Your Place for Support and Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Just Letters and Numbers

 
Post new topic   Reply to topic    Manufacturing Information Solutions Forum Index -> VB Script
View previous topic :: View next topic  
Author Message
dawn
Master Poster


Joined: 26 Jun 2004
Posts: 311
Location: Mishawaka, IN

PostPosted: Mon May 19, 2008 11:10 am    Post subject: Just Letters and Numbers Reply with quote

This will strip out all characters that are not alpha-numeric, that is numbers and letters.

Code:

Option Explicit

dim objRegEx
dim strSearchString

Set objRegEx = CreateObject("VBScript.RegExp")

objRegEx.Global = True   
objRegEx.Pattern = "[^A-Za-z0-9]"
'**If you don't want numbers either then use: "[^A-Za-z]"

strSearchString = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyz!@#$%&*(_+"

strSearchString = objRegEx.Replace(strSearchString, "")

msgbox strSearchString
 

_________________
Dawn Mitchell
Manufacturing Information Solutions
www.mis-group.com
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Manufacturing Information Solutions Forum Index -> VB Script All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group