
RegEx: Pattern Matching going wrong: "\[.+\]\"
Hi,
When I use this patern
"\[.+\]\"
And this code:
For Each objMatch In objRegEx.Matches(txtTest.Text)
MsgBox(objMatch.Value)
Next
Value of the textbox (Case 1)
This is a test [to check for these boxes]
Then I get a messagebox with "[to check for these boxes]"
Value of the textobx (Case 2)
This is a test [to check] for [these boxes]
I expected to get 2 messageboxes "[to check]" and "[these boxex]"
Instead I got one with "[to check] for [these boxes]"
How can I prevent this from happening and actually get 2 messageboxes
(2 Matches)
Thnx.