PauloCastelo
New Member
- Joined
- Jul 7, 2016
- Messages
- 14
Hi folks,
It's my first time here and I'm needing your help.
I'm trying to use a specific regular expression, but when a I try execute, the message shows "Run-time error 5019"
The regular expression I'm using is "(Sumário\n[^]+)".
I done some tests and the error is "^".
How can I done it?
' Execução da Expressão regular
Dim posString As String
Dim newRegEx, newMatch, newMatches
Set newRegEx = New RegExp
newRegEx.pattern = "(Sumario\n[^]+)"
newRegEx.MultiLine = True
newRegEx.IgnoreCase = True
newRegEx.Global = True
Set newMatches = newRegEx.Execute(strTemp)
For Each newMatch In newMatches
RetStr = newMatch.Value
Next
strTemp = RetStr
My idea is take only expressions after word "Sumario".
I used a Macro to take Word Documment to insert in the string (strTemp)
When I tried used newRegEx.pattern = "(Sumario\n[]+)", it's done, but it's not works.
It's my first time here and I'm needing your help.
I'm trying to use a specific regular expression, but when a I try execute, the message shows "Run-time error 5019"
The regular expression I'm using is "(Sumário\n[^]+)".
I done some tests and the error is "^".
How can I done it?
' Execução da Expressão regular
Dim posString As String
Dim newRegEx, newMatch, newMatches
Set newRegEx = New RegExp
newRegEx.pattern = "(Sumario\n[^]+)"
newRegEx.MultiLine = True
newRegEx.IgnoreCase = True
newRegEx.Global = True
Set newMatches = newRegEx.Execute(strTemp)
For Each newMatch In newMatches
RetStr = newMatch.Value
Next
strTemp = RetStr
My idea is take only expressions after word "Sumario".
I used a Macro to take Word Documment to insert in the string (strTemp)
When I tried used newRegEx.pattern = "(Sumario\n[]+)", it's done, but it's not works.