Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple question how to test a strings composition

Status
Not open for further replies.

justagrunt

Technical User
Oct 10, 2002
132
Hi,
Brain dead question but I've never considered it before.
How do you test a string for is makeup.
If I want to test a string to see if it contains 4 digits format like "1234" or test a string if it has 2 alpha and 4 digits like "JN1234" or even if the string is long and made of alpha numerics like text.
Kind Regards.
 
The LIKE operator is a good place to start.

4 digits =
LIKE "####"

2 alpha's followed by 4 numerics =
LIKE "[A-Z][A-Z]####"

That may be all you need. If you need something
fancier, there are regular expressions.
See thread222-487214
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top