javascript-regex-utils

1.1.0 • Public • Published

javascript-regex-utils

js 常用正则方法库,持续添加中...

Installment

npm install javascript-regex-utils --save

Documentation

1. replaceRegexMatchedText

替换正则表达式匹配的文本

Usage

  import { replaceRegexMatchedText } from 'javascript-regex-utils';

  replaceRegexMatchedText('我是中国人${xxxx}', /\${(\w+)}/g, 'allen'); // 我是中国人allen
  replaceRegexMatchedText('我是中国人${name}', /\${(\w+)}/g, {
    name: 'allen',
  }); // 我是中国人allen

Package Sidebar

Install

npm i javascript-regex-utils

Weekly Downloads

3

Version

1.1.0

License

ISC

Unpacked Size

3.13 kB

Total Files

4

Last publish

Collaborators

  • marksman