By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,853 Members | 941 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,853 IT Pros & Developers. It's quick & easy.

Search and Replace using WildCards

P: n/a
I am trying to implement a "Find and Replace" dialog that allows using
wildcards in the find string, much like the Find and Replace Dialogs in Ms
Word, etc. Are there any references or examples on this. I have tried using
the Like comparision operator but about all I can do with it is replace a
whole string that contains the wildcard search string.

I want to do something like finding *mysea?rch in a string like "This is
mysearch string that I want to search" then replace with "NewString" such
that I get "NewString string that I want to search".
--
Dennis in Houston
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi,

Take a look at regex.replace

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

Regular expression info
http://msdn.microsoft.com/library/de...xpressions.asp

http://www.regular-expressions.info/quickstart.html

Regular expression library
http://www.regexlib.com/

Ken
------------------------------

"Dennis" <De****@discussions.microsoft.com> wrote in message
news:2F**********************************@microsof t.com...
I am trying to implement a "Find and Replace" dialog that allows using
wildcards in the find string, much like the Find and Replace Dialogs in Ms
Word, etc. Are there any references or examples on this. I have tried using
the Like comparision operator but about all I can do with it is replace a
whole string that contains the wildcard search string.

I want to do something like finding *mysea?rch in a string like "This is
mysearch string that I want to search" then replace with "NewString" such
that I get "NewString string that I want to search".
--
Dennis in Houston
Nov 21 '05 #2

P: n/a
Thanks Ken. I was, of course, aware of Regex Class but I had hoped not to
have to learn Regex language in depth but probably will have no choice but to
do so. I was hoping some kind programmer had posted some code that would use
the standard wildcards in some Search and Replace code.

"Ken Tucker [MVP]" wrote:
Hi,

Take a look at regex.replace

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

Regular expression info
http://msdn.microsoft.com/library/de...xpressions.asp

http://www.regular-expressions.info/quickstart.html

Regular expression library
http://www.regexlib.com/

Ken
------------------------------

"Dennis" <De****@discussions.microsoft.com> wrote in message
news:2F**********************************@microsof t.com...
I am trying to implement a "Find and Replace" dialog that allows using
wildcards in the find string, much like the Find and Replace Dialogs in Ms
Word, etc. Are there any references or examples on this. I have tried using
the Like comparision operator but about all I can do with it is replace a
whole string that contains the wildcard search string.

I want to do something like finding *mysea?rch in a string like "This is
mysearch string that I want to search" then replace with "NewString" such
that I get "NewString string that I want to search".
--
Dennis in Houston

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.