作者:iamfeiyu1009

1.在检查点中可以勾选regular experiession,输入正则表达式、
2.对象属性或对象库中进行配置
3.描述编程中的使用

Set mydesc=description.Create()
mydesc("html tag").value="P"
mydesc("innertext").value="您目前的积分为[1-9][0-9]{3,}"'匹配四位或以上数字
MyDesc("innertext").RegularExpression = true
'其实这个默认就是true
If   Browser("title:=51testing.*").Page("title:=51testing.*").Frame("name:=51.*").webelement(mydesc).Exist Then
……
End If

常用正则表达式
手机号:1(3|5)[0-9]{9}
实现手机号前带86或是+86的情况:^((\+86)|(86))?(13|5)\d{9}$
汉字:[\u4e00-\u9fa5]
匹配身份证:d{15}|d{18}
email地址:w+([-+.]w+)*@w+([-.]w+)*.w+([-.]w+)*
匹配国内电话号码:[0-9]{3}\-[0-9]{8}|[0-9]{4}\-[0-9]{7}
日期简单匹配(yyyy-mm-dd):[0-9]{4}\-(0|1)[1-9]\-(1|2|3)[0-9]

相关文章:

  • 2022-12-23
  • 2021-10-19
  • 2021-07-08
  • 2022-12-23
  • 2021-10-13
  • 2022-02-11
  • 2021-08-12
猜你喜欢
  • 2021-07-08
  • 2022-02-04
  • 2021-06-19
  • 2022-02-01
  • 2022-12-23
  • 2022-01-03
  • 2022-12-23
相关资源
相似解决方案