|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Search and Replace using WildCardsI 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 Hi,
Take a look at regex.replace http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemtextregularexpressionsregexclassreplacetopic.asp Regular expression info http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconcomregularexpressions.asp http://www.regular-expressions.info/quickstart.html Regular expression library http://www.regexlib.com/ Ken ------------------------------ "Dennis" <Den***@discussions.microsoft.com> wrote in message I am trying to implement a "Find and Replace" dialog that allows usingnews:2F520C4A-6D7E-403B-9EAB-1C528E68603A@microsoft.com... 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 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. Show quoteHide quote "Ken Tucker [MVP]" wrote: > Hi, > > Take a look at regex.replace > > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemtextregularexpressionsregexclassreplacetopic.asp > > Regular expression info > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconcomregularexpressions.asp > > http://www.regular-expressions.info/quickstart.html > > Regular expression library > http://www.regexlib.com/ > > Ken > ------------------------------ > > "Dennis" <Den***@discussions.microsoft.com> wrote in message > news:2F520C4A-6D7E-403B-9EAB-1C528E68603A@microsoft.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 > > >
Timer1_Elapsed problem.
Locate MessageBox over Window how to deserialize an array? How can I get the Menuitem 's name ?? ListViewImageList keeps bitmap locked after disposing what if the database connection isn't close sqlreader Do...while problem MaskedEdit Control Upload file programmatically DataGrid OnPaint/? -How Do I Draw A GDI Type Circle On Top Of A DataGrid |
|||||||||||||||||||||||