问题
I am attempting to learn regex syntax in VBScript by running CurrencyEx.vbs from the following link: https://msdn.microsoft.com/en-us/library/ms974570.aspx
However, the code runs into a compilation error 'Expected identifier' at line 10, character 13, Code: 800A03F2.
do while re.
Any suggestions to run a 'while' loop for a regex object would be helpful.
回答1:
Spurious line break:
do while re.Test(inputstr) <> true
Added:
The last ) in the pattern
\s*((\$\s?)|(£\s?))?((\d+(\.(\d\d)?)?)|(\.\d\d))\s*(UK|GBP|GB|USA|US|USD)?)\s*$
is not matched.
The pattern allows "$ 1.23 UK".
Thou shall not try to learn from code that compares boolean expressions against boolean constants.
来源:https://stackoverflow.com/questions/34663887/unable-to-run-while-loop-related-to-regular-expressions-in-vbscript-running-thro