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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

wildcards in strings

Status
Not open for further replies.

TonyVBnet

Programmer
Mar 31, 2004
17
DE
hi.
now my program is able to search. my last thread
but there's now another problem:
do you know if i can use wildcards for this search? i've tried, but it actually doesn't work. do you have tipps how to use them inside a word? e.g. i'm searching for a word that begins with "b" and ends with "ing" like "beginning".
thx
 
you might be able to use instr. Not sure how you would use a wild card.
 
take a look into regular expressions.

Scott
Programmer Analyst
<{{><
 
thx for your help.
i've taken a look at the regular expressions classes. so i found a code, that helps to search for the "href"-tag. thats not exactly what i need, but it helps. unfortunately i don't understand the "searchword". here it is:
searchWord = "href\s*=\s*(?:""(?<1>[^""]*)""|(?<1>\S+))"
what i understand: "\s*" illustrate spaces (similar to that S stands for all non-space characters), the * is a kind of wildcard (zero or more characters). just like the ? which stands for zero or one character. but what means the rest of the line?
would be great if anybody had an idea.
thx
 
i've really forgotten the main question!
how could i add the "http" in this "searchword"? i want to find all urls, but with href it doesn't work properly, because there are not only http and mailtos (which i only want!). and do you know if (and how) i can use ' instead of "? e.g. in js-files you can find urls in apostrophs.
thx
 
It looks like you can replace the first question mark with your protocol:
[tt]?[/tt] Becomes: [tt](http|mailto)[/tt]

Chip H.

If you want to get the best response to a question, please check out FAQ222-2244 first
 
hi.
thx for your tip, but this also doesn't work. i've tried it out.
perhaps i'll find the right way (but it doesn't seem so!
 
Can you try using the Like keyword, ie.
Code:
If sMyWord Like "b[*]ing" Then bFound = True

Not sure if my syntax is 100% correct - cant check it at the moment, but it's something similar to the above.

There's a thin line between genius, and insanity!
 
thx for your help!
i've found a solution:
searchWord = "(""(http:[^""]*)"")"
so you can find all http-links. works really fine (syntax in regular expressions is sometimes so confusing!)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top