# regexp-utilsjs

> 通用的正则工具

Latest version **3.0.0** (published 2023-11-01) · ISC license · 0 weekly downloads

## Install

```sh
npm install regexp-utilsjs
pnpm add regexp-utilsjs
yarn add regexp-utilsjs
bun add regexp-utilsjs
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2023-11-01 |
| First published | 2020-12-24 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 13.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | FYR |
| Maintainers | yingren |
| Keywords | regexp, rules |

## Links

- npm: https://www.npmjs.com/package/regexp-utilsjs
- Repository: https://github.com/317883224/regexp-utilsjs
- Homepage: https://www.npmjs.com/package/regexp-utilsjs
- Issues: https://github.com/317883224/regexp-utilsjs/issues
- npm.io page: https://npm.io/package/regexp-utilsjs

## Recent versions

- 3.0.0 (latest) — 2023-11-01
- 2.0.0 — 2021-09-13
- 1.0.3 — 2020-12-24
- 1.0.1 — 2020-12-24
- 1.0.0 — 2020-12-24

## README

# regexp-utilsjs

## 介绍

regexp-utilsjs 是纯 js 正则方法库, 包含：数字，联系方式等。

## 特性

-   纯 js

## 更新日志

### [3.0.0]
-   优化
    -   调整一些方法


## 安装

```bash
# npm：
npm i regexp-utilsjs -S
```

## 引入方法

### 方式一. 自动按需引入 (推荐)
babel-plugin-import 是一款 babel 插件，它会在编译过程中将 import 的写法自动转换为按需引入的方式。

```js
// 安装插件
npm i babel-plugin-import -D

// 在 babel.config.js 中配置
plugins: [
    [
        'import',
        {
            libraryName: 'regexp-utilsjs',
            libraryDirectory: 'lib',
            camel2DashComponentName: false
        },
        'regexp-utilsjs'
    ]
];

// 接着你可以在代码中直接使用
import { numberRegexp } from 'regexp-utilsjs';

numberRegexp.test(123) // true
```

### 方式二. 手动按需引入
```js
import numberRegexp from 'regexp-utilsjs/lib/numberRegexp';

numberRegexp.test(123) // true
```

### 方式三. 导入所有
```js
import regexpUtilsjs from 'regexp-utilsjs';

regexpUtilsjs.numberRegexp.test(123); // true
```

## 文档

| 正则类型 |  说明 | test | replace |
| :-----------: | :-----------: | :-----------: | :-----------: |
| numberRegexp | 数字 | <span style="color: #409EFF;">√</span> | <span style="color: #409EFF;">√</span> |
| numberPositiveRegexp | 正数 | <span style="color: #409EFF;">√</span> | <span style="color: #409EFF;">√</span> |
| numberNegativeRegexp | 负数 | <span style="color: #409EFF;">√</span> | <span style="color: #409EFF;">√</span> |
| integerRegexp | 整数 | <span style="color: #409EFF;">√</span> | <span style="color: #409EFF;">√</span> |
| integerPositiveRegexp | 正整数 | <span style="color: #409EFF;">√</span> | <span style="color: #409EFF;">√</span> |
| integerNegativeiRegexp | 负整数 | <span style="color: #409EFF;">√</span> | <span style="color: #409EFF;">√</span> |
| chineseRegexp | 中文 | <span style="color: #409EFF;">√</span> | <span style="color: #409EFF;">√</span> |
| englishRegexp | 英文 | <span style="color: #409EFF;">√</span> | <span style="color: #409EFF;">√</span> |
| contactRegexp | 联系方式，包括手机号和固定电话 | <span style="color: #409EFF;">√</span> | <span style="color: #F56C6C;">×</span> |
| emailRegexp | 邮箱 | <span style="color: #409EFF;">√</span> | <span style="color: #F56C6C;">×</span> |
| idcardRegexp | 身份证 | <span style="color: #409EFF;">√</span> | <span style="color: #F56C6C;">×</span> |
| internetURLRegexp | 网址 | <span style="color: #409EFF;">√</span> | <span style="color: #F56C6C;">×</span> |
| landlineRegexp | 固定电话 | <span style="color: #409EFF;">√</span> | <span style="color: #F56C6C;">×</span> |
| phoneRegexp | 手机号 | <span style="color: #409EFF;">√</span> | <span style="color: #F56C6C;">×</span> |

## 联系方式

- qq 317883224@qq.com

## 链接

- [NPM](https://www.npmjs.com/package/configjs-utilsjs)
- [GITHUB](https://github.com/317883224/configjs-utilsjs)

---
_Source: https://npm.io/package/regexp-utilsjs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
