Option
Explicit
Sub
Test()
Dim
strExpression
As
String
Dim
objMatches
As
Object
Dim
objMatch
As
Object
strExpression =
"liquidity GG 3.25, market WB 0.25, points 15"
With
CreateObject(
"VBScript.RegExp"
)
.Global =
True
.IgnoreCase =
True
.MultiLine =
False
.Pattern =
" *([^,]+?) *((\d+)(\.\d+)?)"
Set
objMatches = .Execute(strExpression)
End
With
For
Each
objMatch
In
objMatches
Debug.Print
"'"
; objMatch.SubMatches(0);
"'"
; Tab(4); 'Ausdruck vor der Zahl
Debug.Print
"'"
; objMatch.SubMatches(1);
"'"
; Tab(4); 'die Dezimalzahl
Debug.Print
"'"
; objMatch.SubMatches(2);
"'"
; Tab(4); 'Vorkommastelle(n) der Dezimalzahl
Debug.Print
"'"
; objMatch.SubMatches(3);
"'"
'Nachkommastelle(n) der Dezimalzahl mit Punkt
Next
End
Sub