mm_matchs 1.1.2 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.js +1 -1
  2. package/package.json +1 -1
  3. package/test.js +3 -0
package/index.js CHANGED
@@ -453,7 +453,7 @@ Matchs.prototype.web = function(str, format) {
453
453
  * @return {String} 返回新的格式
454
454
  */
455
455
  Matchs.prototype.url = function(str, format) {
456
- var rx = /((https|http|ftp|rtsp|mms)?:\/\/)?[a-zA-Z0-9_\-.]+[/a-zA-Z0-9_\-]+\/?\??[a-zA-Z0-9_\-.=&%]*/;
456
+ var rx = /((https|http|ftp|rtsp|mms)?:\/\/)?[a-zA-Z0-9_\-]+\.[/a-zA-Z0-9_\-.]+[/a-zA-Z0-9_\-]+\/?\??([a-zA-Z0-9_\-.=&%]+)?/;
457
457
  return change(str, format, rx, '{网址}');
458
458
  };
459
459
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mm_matchs",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "description": "这是用来匹配复杂的字符串结构的函数,可以匹配前缀包含、后缀包含、以及时间、地点等",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/test.js CHANGED
@@ -46,6 +46,9 @@ console.log("http://www.baidu.com/ad/city?test=demo&keyword=isay中华任命功
46
46
  console.log("http://www.baidu.com/ad/city?".matchs('{网址}'));
47
47
  console.log("http://www.baidu.com/ad/city".matchs('{网址}'));
48
48
  console.log("http://www.baidu.com/ad/city/".matchs('{网址}'));
49
+ console.log("http://baidu.com/ad/city/img/head.png".matchs('{网址}'));
50
+ console.log("573242395@qq.com".matchs('{网址}'));
51
+ console.log("早上8:00到晚上02:00".matchs('{网址}'));
49
52
 
50
53
  // str = "1991-04-01 12:15:36";
51
54
  // console.log(str.matchs('{日期时间}'));