仪陇家园分类信息网、仪陇生活网、仪陇家园网

搜索

XRegExp V2.0 JavaScript正则表达式库

[复制链接]
seo 发表于 2021-9-14 15:31:26 | 显示全部楼层 |阅读模式
脚本大小:12KB
脚本语言:简体中文
脚本类型:国产软件
脚本授权:免费软件
更新时间:2014-09-16 17:20:28
脚本类别:其它脚本
相关链接: 官方网址  演示地址
网友评分:3分
应用平台:javascript

XRegExp 是一个开源的 JavaScript 库提供一个参数化、可扩展的支持各种浏览器的正则表达式的实现库,支持附加语法、标志以及方法。
XRegExp 完全兼容 ES3 和 ES5 正则表达式使用习惯,已通过测试的浏览器包括:Internet Explorer 5.5–8, Firefox 2–3.6, Safari 3–4, Chrome 1–4, and Opera 9.5–10.5.
在线测试://regexpal.com/
XRegExp(pattern, [flags])
Accepts a pattern and flags; returns a new, extended RegExp object. Differs from a native regular expression in that additional syntax and flags are supported and cross-browser regex syntax inconsistencies are ameliorated.
Parameters: •pattern : String or RegExp
The regular expression pattern String, or an existing RegExp object to copy.
•flags : String [optional]
The regular expression flags; may include non-native flags s and x. Flags cannot be provided when constructing one RegExp from another.
Returns: •RegExp
An extended regular expression object.

  1. var regex = XRegExp("(? [0-9]+ ) [-/.\\s] # month\n\
  2. (? [0-9]+ ) [-/.\\s] # day \n\
  3. (? [0-9]+ ) # year ", "x");
  4. var input = "04/20/2009";
  5. input.replace(regex, "${year}-${month}-${day}"); // "2009-04-20"
  6. var match = regex.exec(input);
  7. match.month; // "04"
  8. regex instanceof RegExp; // true
  9. regex.constructor == RegExp; // true
复制代码
  
四五互联移动下载
  • 群英网络电信下载
  • 巨牛网络电信下载
  • 创梦网络电信下载
  • 回复

    使用道具 举报

    全部回复0 显示全部楼层

    发表回复

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    楼主

    审核员

    热门推荐

    联系客服 关注微信 下载APP 返回顶部 返回列表