Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21847

[RESOLVED] How do I get RegExp to return MULTIPLE matches?

$
0
0
Ok so I've got this

Code:

Dim RegExp As New RegExp
Dim Matches As MatchCollection
a = "abc123xyzc12jjj"
RegExp.Pattern = "2."

Set Matches = RegExp.Execute(a)
Print Matches.Count

By the name of the object type MatchCollection, it would seem that it is an object that would support multiple matches. Yet the above code (which should produce multiple matches) only produces one match. The first match should be "23" and the second match should be "2j". Yet it only returns one match, as I can tell by printing the matches count.

Please help. Thanks in advance.

Viewing all articles
Browse latest Browse all 21847

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>