I want to match
Quote:
images/folder 1/pic 009.JPG
|
in the following text:
Quote:
<gallery>
<pic path="images/folder 1/pic 009.JPG" desc="desc 1" />
<pic path="images/folder 1/pic 010.JPG" desc="desc 2" />
</gallery>
|
but it just matches the part (stated in the comments below in the codes)
Code:
Sub RegExp()
Dim oRegExp As RegExp
Dim oMatchCollection As MatchCollection
Dim oMatch As Match
Set oRegExp = New RegExp
''
oRegExp.Pattern = """.*JPG"""
'' return:
'' "images/folder 1/pic 009.JPG" desc="desc 1" /><pic path="images/folder 1/pic 010.JPG"
oRegExp.Global = True
oRegExp.IgnoreCase = True
'' oRegExp.MultiLine = False
Set oMatchCollection = oRegExp.Execute(ActiveDocument.Range)
For Each oMatch In oMatchCollection
Debug.Print oMatch.Value
Next oMatch
Set oMatch = Nothing
Set oMatchCollection = Nothing
Set oRegExp = Nothing
End Sub