Basically, I'm looking for "Left$(strName, 5)" and "Left$(strThisName, 5)",
etc. What I'd like to do is use a wildcard, like "Left$(*, 5)" to locate
anywhere I'm using the leftmost 5 characters. But I can't use wildcards
within the IDE, or, for that matter, most text searching programs I have
(like NotePad, WordPad or Word).
For another project, I was looking for "\??\" (any two characters with
backslashes on each side).
Is there a tool that I can use to search through code using wildcards? I'm
not talking about writing a program to do this; that I could do. I'm looking
for an existing text editing or text searching tool that would allow it. Or
maybe a way of using the tools I have that I don't know about! ;-) I've
tried using the wildcards option in Word, but not had much success. For
example, searching for "v:\*\????_*" should find "v:\10-11\1000_sh1_B.tif",
but it doesn't.
--
Regards,
Rick Raisley
heavymetal-A-T-bellsouth-D-O-T-net
Regular Expressions
http://www.regular-expressions.info/reference.html
How to use RegExp in Word will depend on the version of Office you are
using. There are many examples and tutorials availble on the web.
Frankly, go research the many dedicated programmer editors out there.
-ralph
Function AmbiguousInStr(TextString As String, Pattern As String, _
Optional Start As Long = 1) As Long
Dim X As Long
Do While Left(Pattern, 1) = "*"
Pattern = Mid(Pattern, 2)
Loop
For X = Start To Len(TextString)
If Mid(TextString, X) Like Pattern & "*" Then
AmbiguousInStr = X
Exit Function
End If
Next
End Function
The Pattern argument would be any valid Like operator Pattern. The function
will look for that pattern in the TextString argument and return the first
position in the string where that pattern exists. The optional Start
argument allows you to begin searching for the Pattern at that character
position within the TextString argument.
--
Rick (MVP - Excel)
"Rick Raisley" <heavymetal-A-T-bellsouth-D-O-Tnet> wrote in message
news:OeSvgFYj...@TK2MSFTNGP05.phx.gbl...
Have you tried VB's Find dialog? It has pattern search option, but limited.
MZTools also has the same thing. Beyond that, you need to use external
program. One such free program that adds syntax coloring is PSPad. It
supports regular expressions. I am not sure about the specific cases you
mentioned, but you could use 5 "?". As for "\??\", the "\" character may
have been considered as special character and needs to be doubled.
--
Regards,
Rick Raisley
heavymetal-A-T-bellsouth-D-O-T-net
"Rick Rothstein" <rick.new...@NO.SPAMverizon.net> wrote in message
news:%23%237zcxYj...@TK2MSFTNGP05.phx.gbl...
<red face>
I can't believe I didn't try the Pattern Matching option! I guess I was
expecting terminology with Wildcard in it, and somehow didn't notice it.
Yes, it does do pretty much what I want it to. And the "\" is an escape
character, as you mention, and I have to use "\\" to actually find a
backslash when searching from Word. Also found a good web site on wildcard
searches in Word, etc:
http://www.gmayor.com/replace_using?wildcards.htm
Thanks for the answers that were apparently obvious to everyone but me.
First day back of the new year, after all!
</red face>