# regexp-hub

> A collection of useful regex patterns

Latest version **0.0.1** (published 2018-07-27) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2018-07-27 |
| First published | 2018-07-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 30.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | qizf |
| Maintainers | qizf |
| Keywords | regex, regexp, regular, expression, patterns |

## Links

- npm: https://www.npmjs.com/package/regexp-hub
- npm.io page: https://npm.io/package/regexp-hub

## Recent versions

- 0.0.1 (latest) — 2018-07-27

## README

# regexp hub
A collection of useful regexp patterns. if you find any error or have some useful regexp is not in here, please tell me. welcome pull request, thank you very much...
Or you

### regexps

```javascript
  'require': /^.+$/, // required
  'username': /^[a-zA-Z0-9_-]{3,16}$/, // username
  'positiveInteger': /^\d+$/, // positive integer
  'negativeInteger': /^-\d+$/, // negative integer
  'integer': /^-?\d+$/, // integer
  'positiveNumber': /^\d*\.?\d+$/, // positive or negative number
  'negativeNumber': /^-\d*\.?\d+$/, // positive or negative number
  'positiveOrNegativeNumber': /^-?\d*\.?\d+$/, // positive or negative number
  'yyyy/mm/dd hh:mm:ss': /^([0-9][0-9][0-9][0-9])([ \/\-])(0?[1-9]|1[012])\2(0?[1-9]|[12][0-9]|3[01])(([ -])([0-1]?[0-9]|2[0-3]):[0-5]?[0-9]:[0-5]?[0-9])?$/, // yyyy/mm/dd hh:mm:ss
  'dd/mm/yyyy hh:mm:ss': /^(0?[1-9]|[12][0-9]|3[01])([ \/\-])(0?[1-9]|1[012])\2([0-9][0-9][0-9][0-9])(([ -])([0-1]?[0-9]|2[0-3]):[0-5]?[0-9]:[0-5]?[0-9])?$/, // dd/mm/yyyy hh:mm:ss
  '24hourTime': /^([01]?[0-9]|2[0-3]):[0-5][0-9]$/, // 24hour time
  'htmlTag': /^<([a-z1-6]+)([^<]+)*(?:>(.*)<\/\1>| *\/>)$/, // html tag
  'url': /^((https?|ftp|file):\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/, //url
  'email': /^.+@.+$/, // email
  'IPv4': /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,
  'IPv6': /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,
  'en': /^[a-zA-Z]+$/, // en

  'zh': /^[\u4e00-\u9fa5]+$/, // chinese
  'zh-identity': /(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)|(^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{2}$)/, // china id card
  'zh-mobile': /^1\d{10}$/, //china mobile number
  'zh-postcode': /^\d{6}$/ //china postcode

```

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