語言 VBA excel 2007 windows XP
code as follow
********************************************************************
Dim myRegExp As Object
Set myRegExp = New RegExp
myRegExp.IgnoreCase = True
myRegExp.Global = True
myRegExp.Pattern = "^(\d+\s+[0-7]\s+\d+(uA|mV))"
Dim s As String: s = "6532 0 70mV "
Dim m As Object
Set m = myRegExp.Execute(s)
**********************************************************************
I want to match "6532 0 70mV" or "6532 0 70uA"
but when s is "6532 0 70uA" the m contains only one item,which is
"6532 0 70uA" http://i.imgur.com/PFQNfZ9.png ,but when
s="6532 0 70mV" it contains 2 items "6532 0 70mV" and "mV"
http://i.imgur.com/Pg2gqNu.png,
I don't know why the later case contains 2