You can use the LIKE operator on strings:
If value Like "AB###" then ok = True
? = single character, * = 0 or more characters, # = single digit
You can include or exclude characters in the search by inserting a list
enclosed in a pair of sq brackets.
You exclude with !
If value Like "[A-C]####" then ok = true --1st is A B or C, then 4 digits
If value like "[!A-C]####" then ok = True --1st is not A or B or C, then
4 digits
Look for only alpha characters: If Not (value like (*[!A-Za-z]*")
Look for only digits: If Not (value like "*[0-9]*")
Look for any character but no consecutive punctuation symbols:
If Not (value Like "*[:;.,][:;.,]") then ok=true
This is faster than regex, but slower than manually comparing strings.
HTH,
Robin S.
Ts'i mahnu uterna ot twan ot geifur hingts uto.
-----------------------------------------------
"anil" <an**********@gmail.comwrote in message
news:11**********************@k78g2000cwa.googlegr oups.com...
Hi everybody,
I have some n number of Names, the string i am declaring should take
any names,
for Ex: As for searching any file we use "*.*" is there any thing
simillar to this that i can use in VB code to specify any string.
Thanks & Regards
Anil.Hungund