I have a subroutine that I use to set up Regular Expressions. From this I pull out certain pieces of text. Under certain circumstances, I want to pull out certain SubMatches from the Matches collection.
Can I send this code:
Through a variable to a subroutine such that this code:
will be intreperted as this code?
I tried setting a variable in both of the following ways but neither worked:
Many thanks!
Onwards,
Q-
Can I send this code:
Code:
Match.SubMatches(1) & "," & Match.SubMatches(3) & ","
Through a variable to a subroutine such that this code:
Code:
For Each Match in Matches ' Iterate Matches collection.
RetStr = RetStr & sReplacement
RegExp = RetStr
Next
will be intreperted as this code?
Code:
For Each Match in Matches ' Iterate Matches collection.
RetStr = RetStr & Match.SubMatches(1) & "," & Match.SubMatches(3) & ","
RegExp = RetStr
Next
I tried setting a variable in both of the following ways but neither worked:
Code:
sReplacement= "Match.SubMatches(1) & "," & Match.SubMatches(3) & ","" ' did not work
sReplacement= Match.SubMatches(1) & "," & Match.SubMatches(3) & "," ' did not work
Many thanks!
Onwards,
Q-