473,545 Members | 2,085 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Wild card sarch in VB/VB.net

Hi,
Could u please let me know how I can do wildcard search in VB.
Examples:
Source string : "Microsoft Dotnet"
Wildcard string M*Dot*
Result should be Microsoft Dotnet

If
Wildcard string is M*Dot
Result should be "Match not found"
If
Wildcard string is M?c*Dot
Result should be Microsoft Dotnet

Your help will be greatly appreciated.
Thanks,
Balaji
Nov 20 '05 #1
3 21565
Hi Balaji,

What you ask is the regulair expression those are made for questions as
yours, have a look at Regex class

http://msdn.microsoft.com/library/de...classtopic.asp

I hope this helps,

Cor
Hi,
Could u please let me know how I can do wildcard search in VB.
Examples:
Source string : "Microsoft Dotnet"
Wildcard string M*Dot*
Result should be Microsoft Dotnet

If
Wildcard string is M*Dot
Result should be "Match not found"
If
Wildcard string is M?c*Dot
Result should be Microsoft Dotnet

Your help will be greatly appreciated.
Thanks,
Balaji

Nov 20 '05 #2
Hi,

In addition to Cor's comments you can use like to compare strings

Dim strTest As String = "Microsoft Dotnet"

If strTest Like "M*Dot*" Then MessageBox.Show ("Wildcard match")

Ken

---------------------------

"Balaji" <ba*****@hotmai l.com> wrote in message
news:eu******** ********@TK2MSF TNGP09.phx.gbl. ..
Hi,
Could u please let me know how I can do wildcard search in VB.
Examples:
Source string : "Microsoft Dotnet"
Wildcard string M*Dot*
Result should be Microsoft Dotnet

If
Wildcard string is M*Dot
Result should be "Match not found"
If
Wildcard string is M?c*Dot
Result should be Microsoft Dotnet

Your help will be greatly appreciated.
Thanks,
Balaji

Nov 20 '05 #3
* "Ken Tucker [MVP]" <vb***@bellsout h.net> scripsit:
In addition to Cor's comments you can use like to compare strings

Dim strTest As String = "Microsoft Dotnet"

If strTest Like "M*Dot*" Then MessageBox.Show ("Wildcard match")


Full ACK, but don't forget that 'Like' is still buggy in some
situations.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1346
by: Gerry Viator | last post by:
Hi all, I want to remove the test after a period? Why does the wild card * not work? Dim test As String = "This is just a test report. ERCP" MessageBox.Show(Replace(test, ".*", "."))
1
1712
by: Steve T | last post by:
I have just contracted with a firm that is using a front-end web interface to access our sales data. They developed it with Microsoft Dotnet, and it uses Microsoft SQL as the database. When I search test/note fields, they say I have to do a wild card search *word* to pull up any records with "word" in that field. With our previous...
1
6077
by: Tempy | last post by:
Could somebody please tell me if it is possible and if how? I am wanting to do : Iif(="*PE","Y","N") In other word i want it to fine HZPE, AEPE, HEPE etc... Les Stout *** Sent via Devdex http://www.devdex.com *** Don't just participate in USENET...get rewarded for it!
1
1864
by: =?Utf-8?B?S3Jpc3RpbmUgdGhlIERyYWdvbkxhZHk=?= | last post by:
Can anyone advise re spam emails which come through with the word V***gra (where the * are varying letters) - how do I specify the word just as I've typed the word with the asterisks? I can't find anywhere where the wild card characters are noted, and the rule I've tried to stop these emails doesn't work: ie with v???gra in the subject or...
0
2698
by: fullmetal87 | last post by:
Hi guys, I am having this problem I want to do a search with wild card e.g. ABC will retrieve all the group XYZABC123 or SKDABC or ABC234KD do anyone know the wildcard character to search?? Thanks in advance. For i = 0 To arrList.Count - 1 'Get all members of each group objDirectoryEntry = New...
2
2064
by: psbasha | last post by:
Hi, How to get a File Wild Card using Tkinter Module?. Could anybody has used this option.If so, the smaple snippet of the code will really help me. Thanks PSB
0
1286
by: shamaila | last post by:
wild card characters are used to match strings as select * from table where name LIKE '%brown%'; but doesnt supports matching of dates,number what will we do if we want approximate matching of dates and numbers??
0
1953
by: jmelasic1 | last post by:
I am working on a form now that has two things in it: a text box and a subform. The subform is from a query. The text box is just a normal text box. However, I would like to link the text box to the subform in a manner that would allow the material entered in the text box to act as a "wild card" search for the subform. So, if I entered the...
3
2039
rcollins
by: rcollins | last post by:
Here is the criteria I am using for my report... (Permissions.Path)=!!) On the criteria form, if I pick R:\Acct\ from the list, I get just those values. I would like to get more, like R:\Acctg\EXCEL\ACCOUNTS PAYABLE, but am not sure how to use the wild card here. So far all of my attempts have been not good. Please help
7
9245
by: W. eWatson | last post by:
Is it possible to do a search for a wild card string in another string. For example, I'd like to find "v*.dat" in a string called bingo. v must be matched against only the first character in bingo, and not simply found somewhere in bingo, as might be the case for "*v*.dat". -- Wayne Watson (Watson Adventures, Prop., Nevada City, CA) ...
0
7401
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7656
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7423
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7757
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5329
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4945
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3443
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1884
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
704
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.