# cc-regex

> 'foo@example.com'.match(/\x{email}/)

Latest version **1.0.7** (published 2022-08-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install cc-regex
pnpm add cc-regex
yarn add cc-regex
bun add cc-regex
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2022-08-15 |
| First published | 2022-08-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 8.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | name |
| Maintainers | salamander_jp |
| Keywords | RegEx, RegExp, Regular expression, Character Classes |

## Links

- npm: https://www.npmjs.com/package/cc-regex
- Repository: https://github.com/GitHub30/cc-regex
- Issues: https://github.com/GitHub30/cc-regex/issues
- npm.io page: https://npm.io/package/cc-regex

## Recent versions

- 1.0.7 (latest) — 2022-08-15
- 1.0.6 — 2022-08-15
- 1.0.5 — 2022-08-15
- 1.0.4 — 2022-08-15
- 1.0.3 — 2022-08-15
- 1.0.2 — 2022-08-15
- 1.0.1 — 2022-08-15
- 1.0.0 — 2022-08-15

## README

[![npm version](https://badge.fury.io/js/cc-regex.svg)](https://badge.fury.io/js/cc-regex)

# cc-regex
Regular expression for Character classes

## Usage

### Find an email address

```javascript
'foo@example.com'.match(/\x{email}/g)
// ['foo@example.com']
```

### Find a URL

```javascript
'https://example.com/foo/bar'.match(/\x{url}/g)
// ['https://example.com/foo/bar']
```

### Find a 都道府県

```javascript
'島根県にパソコンなんてあるわけないじゃん'.match(/\x{都道府県}/g)
// ['島根県']
```

### Find a IP address

```javascript
'127.0.0.1'.match(/\x{ip}/g)
// ['127.0.0.1']
```

### Find a FQDN

```javascript
'example.com sub.example.com'.match(/\x{fqdn}/g)
// ['example.com', 'sub.example.com']
```

### Find a Location

```javascript
const str = '時どき私はそんな路を歩きながら、ふと、そこが京都ではなくて京都から何百里も離れた仙台とか長崎とか――そのような市へ今自分が来ているのだ――という錯覚を起こそうと努める。'
await str.matchAsync(/\x{場所}/g)
// ['京都', '京都', '仙台', '長崎']
```

### Find a Person

```javascript
const str = '昨日、ジョンと山田太郎は松のやでカツ丼を食した。'
await str.matchAsync(/\x{人物}/g)
// ['ジョン', '山田太郎']
```

## Install

```bash
npm install cc-regex
```

![image](https://user-images.githubusercontent.com/12811398/184637627-af99820e-40e6-4bd3-99ea-aba73a27fcab.png)

### for browser

```html
<script src="https://github30.github.io/cc-regex/index.js">
```

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