Jump to content
Sign in to follow this  
erezlevi

string check only english and numbers?

Recommended Posts

erezlevi

hi,

how can I check that a string only contains english characters (upper and lower case) and numbers but not any other like Unicode?

I'v tried using stringsplit and Arrays that contains all english characters and numbers, and every time to check that each char in the original string is compared to the Array and if there is a match it goes on... but is there a simpler way?

Share this post


Link to post
Share on other sites
Bowmore

hi,

how can I check that a string only contains english characters (upper and lower case) and numbers but not any other like Unicode?

I'v tried using stringsplit and Arrays that contains all english characters and numbers, and every time to check that each char in the original string is compared to the Array and if there is a match it goes on... but is there a simpler way?

Have a look at StringRegExp()

Something like this should work.

If Not StringRegExp($TestString,'^[!-£]*$') Then
    MsgBox(0,"Error","$TestString contains ivalid characters")
EndIf

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×