473,473 Members | 1,842 Online
Bytes | Software Development & Data Engineering Community
Create 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 21562
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*****@hotmail.com> wrote in message
news:eu****************@TK2MSFTNGP09.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***@bellsouth.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
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
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...
1
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...
1
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...
0
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??...
2
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
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...
0
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...
3
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...
7
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,...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.