常用正则表达式

  1. 只能是数字或字母或-或_     /^[w-_]+$/
  2. 文件路径验证            /^[a-zA-Z]:[\a-zA-Z0-9_\]+[.]?[a-zA-Z0-9_]+$/
  3. 验证只能是数字          /^+?[1-9][0-9]*$/
原文地址:https://www.cnblogs.com/chenmenghappy/p/3270057.html