Search and Replace using WildCards

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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".
 
Hi,

Take a look at regex.replace

http://msdn.microsoft.com/library/d...tregularexpressionsregexclassreplacetopic.asp

Regular expression info
http://msdn.microsoft.com/library/d...s/cpguide/html/cpconcomregularexpressions.asp

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

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

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

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".
 
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.
 
Back
Top