New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

yi-regex

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yi-regex

提供一些常用的正则表达式处理方法

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

regex

提供一些常用的正则表达式处理方法。 ##安装

    npm install yi-regex

##引入

Regex = require('yi-regex');

##使用

  • match(regex,string)

    regex:正则表达式

    string:需要匹配的字符串

    return:Array匹配结果

result = Regex.match(/id=(\d+)/, 'http://item.taobao.com/item.htm?spm=2013.1.w1057672648.1.zlrrXo&id=21482588062');
  • matchAll(regex,string)

    regex:正则表达式

    string:需要匹配的字符串

    return:Array匹配结果

result = Regex.matchAll(/\w+=[^&]*/g, 'http://item.taobao.com/item.htm?spm=2013.1.w1057672648.1.zlrrXo&id=21482588062');
  • contain(string,substring)

    string:字符串

    substring:子字符串

    return:Boolean 字符串是否包含子串

result = Regex.contain('http://item.taobao.com/item.htm?spm=2013.1.w1057672648.1.zlrrXo&id=21482588062', 'item.taobao.com/item.htm');

Keywords

regex

FAQs

Package last updated on 24 Feb 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts