Unable to run while loop related to regular expressions in vbscript running through Windows based script host

旧时模样 提交于 2019-12-12 03:14:18

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!