Home All Groups Group Topic Archive Search About

How to do the pattern?

Author
19 Mar 2006 10:38 AM
yxq
Hello,
I want to get the strings that match c*.txt ( * means asterisk wildcard)
from some strings below:

c1234.txt
1234.txt
a1234.exe
cqwer.txt
casd.txt

I want to use regular or function, do not want to use if....then...
How to do?

Thank you

Author
19 Mar 2006 12:36 PM
Herfried K. Wagner [MVP]
"yxq" <ga***@163.net> schrieb:
> I want to get the strings that match c*.txt ( * means asterisk wildcard)
> from some strings below:
>
> c1234.txt
> 1234.txt
> a1234.exe
> cqwer.txt
> casd.txt
>
> I want to use regular or function, do not want to use if....then...

Check out the documentation of VB's 'Like' operator.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Author
19 Mar 2006 7:55 PM
Jeff Jarrell
"regular expressions" are another technique to be aware of.  in this case
the regular expression is "^c".

Get this tool and play with it.  It will even generate the code for doing
evaluating a regular expression for you.
http://www.sellsbrothers.com/tools/#regexd



Show quoteHide quote
"yxq" <ga***@163.net> wrote in message
news:eH9K9E0SGHA.5736@TK2MSFTNGP10.phx.gbl...
> Hello,
> I want to get the strings that match c*.txt ( * means asterisk wildcard)
> from some strings below:
>
> c1234.txt
> 1234.txt
> a1234.exe
> cqwer.txt
> casd.txt
>
> I want to use regular or function, do not want to use if....then...
> How to do?
>
> Thank you
>
>
>