![]() |
|
|
|
#1
|
|||
|
|||
|
Code:
Sub regexp()
Dim s(3) As String
s(0) = "recent photo"
s(1) = "photo"
s(2) = "recentphoto"
With CreateObject("vbscript.regexp")
.Pattern = "(recent ){0,1}photo"
.IgnoreCase = True
.Global = True
For x = 0 To 2
For Each oMatch In .Execute(s(x))
MsgBox oMatch
Next oMatch
Next
End With
End Sub
"photo" "recent photo" but don't want: "recentphoto" Thank you. |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
VBScript.RegExp: exclude a particular word
|
tinfanide | Excel Programming | 2 | 06-07-2012 06:52 AM |
WORD: Rtf and search-replace (regexp/fonts)
|
seteshpl | Word | 1 | 09-06-2011 01:35 AM |