# regexpjs

> useful regular expression pattern

Latest version **1.1.4** (published 2022-01-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install regexpjs
pnpm add regexpjs
yarn add regexpjs
bun add regexpjs
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.4 |
| Published | 2022-01-26 |
| First published | 2018-11-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 9.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | uznam8x |
| Maintainers | uznam8x |
| Keywords | javascript, regexp, uznam8x, es6 |

## Links

- npm: https://www.npmjs.com/package/regexpjs
- Repository: https://github.com/uznam8x/regexpjs
- Issues: https://github.com/uznam8x/regexpjs/issues
- npm.io page: https://npm.io/package/regexpjs

## Recent versions

- 1.1.4 (latest) — 2022-01-26
- 1.1.3 — 2021-12-23
- 1.1.2 — 2021-12-22
- 1.0.9 — 2020-01-29
- 1.0.8 — 2020-01-23
- 1.0.7 — 2020-01-23
- 1.0.3 — 2020-01-20
- 1.0.2 — 2018-11-07
- 1.0.1 — 2018-11-07
- 1.0.0 — 2018-11-06

## README

# Regexp JS

## Installation
```
npm i regexpjs
```

## Usage
```javascript
const {pattern, match} = require('regexpjs');
console.log(pattern.email('user@domain.com'));
//-> ["user", "domain.com"]

console.log(match(/\w+/g, 'hello world'));
//-> ['hello', 'world']
```

## API
```javascript
/* 1.1.4 */
pattern.hex('#fff')
["ff", "ff", "ff"]

pattern.rgba('rgba(255, 255, 255, 1)')
[255, 255, 255, 1]

pattern.p3('#fff') // or 'rgba(255, 255, 255, 1)'
[1, 1, 1, 1]

/* 1.1.1 */
pattern.qs('a=1&b=2')
[["a", 1], ["b", 2]]

pattern.digit('a1b2c3')
[1, 2, 3]

pattern.htmlAttrs('<img src="https://uznam8x.tistory.com" alt="" />')
[["src","https://www.domain.com"], ["alt",""]]

/* 1.0.9 */
pattern.creditCard('4111111111111111')
["Visa"]
// Ouput e.g : [ 'American Express', 'BCGlobal', 'Carte Blanche', 'Diners Club', 'Discover', 'Insta Payment''JCB', 'Korean Local', 'Laser', 'Maestro', 'Master','Solo', 'Switch', 'Union Pay', 'Visa' ]

pattern.fileExt('https://www.domain.com/image/1234.jpg')
[".jpg"]

pattern.currency('12345678')
["12","345","678"]

pattern.email('user@domain.com')
["user","domain.com"]

pattern.firstLetters('hello world')
['h', 'w']

pattern.ip('192.168.0.1')
["192","168","0","1"]

pattern.letters('hello world')
["hello", "world"]

pattern.mac('AA:BB:CC:DD:EE:FF')
["AA","BB","CC","DD","EE","FF"]

pattern.password('aAzZ1!a_')
["aAzZ1!a_"]

pattern.telephone('01012345678')
["010","1234","5678"]

pattern.url('https://user:pass@abcd.domain.com:8080/first?a=1#hash')
["https","user","pass","abcd.domain.com","8080","first","a=1"]
```

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