Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在编写一些 Selenium 测试,需要确认是否存在具有动态日期和货币组件的文本字符串。
示例:“这是日期 dd/dd/dd,这是金额 $ddd.dd。”
这可能与 Selenium 正则表达式实现有关吗?
谢谢,理查德
如果我没记错的话 selenium 支持 javascript 的全部功能
日期 dd/mm/yyyy
1900 年 1 月 1 日至 2099 年 12 月 31 日
匹配无效日期,例如 2 月 31 日
接受破折号、空格、正斜杠和点作为日期分隔符
(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)[0-9]{2}
货币
\$\d*(\.\d*)?