# non-4byte-chars-regex

> Regular expression which matches a string with no 4-byte characters

Latest version **1.0.0** (published 2016-11-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install non-4byte-chars-regex
pnpm add non-4byte-chars-regex
yarn add non-4byte-chars-regex
bun add non-4byte-chars-regex
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2016-11-08 |
| First published | 2016-11-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Shinnosuke Watanabe |
| Maintainers | shinnn |
| Keywords | regular-expression, regex, regexp, 4-byte, emoji, match, unicode |

## Links

- npm: https://www.npmjs.com/package/non-4byte-chars-regex
- Repository: https://github.com/shinnn/non-4byte-chars-regex
- Homepage: https://github.com/shinnn/non-4byte-chars-regex#readme
- Issues: https://github.com/shinnn/non-4byte-chars-regex/issues
- npm.io page: https://npm.io/package/non-4byte-chars-regex

## Recent versions

- 1.0.0 (latest) — 2016-11-08
- 0.0.0 — 2016-11-08

## README

# non-4byte-chars-regex

[![NPM version](https://img.shields.io/npm/v/non-4byte-chars-regex.svg)](https://www.npmjs.com/package/non-4byte-chars-regex)
[![Bower version](https://img.shields.io/bower/v/non-4byte-chars-regex.svg)](https://github.com/shinnn/non-4byte-chars-regex/releases)
[![Build Status](https://travis-ci.org/shinnn/non-4byte-chars-regex.svg?branch=master)](https://travis-ci.org/shinnn/non-4byte-chars-regex)
[![devDependencies Status](https://david-dm.org/shinnn/non-4byte-chars-regex/dev-status.svg)](https://david-dm.org/shinnn/non-4byte-chars-regex?type=dev)

[Regular expression](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp) which matches a string with no [4-byte characters](https://github.com/shinnn/is-4byte-char/)

```javascript
/^(?:[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*$/
```

## Installation

### [npm](https://www.npmjs.com/)

```
npm install non-4byte-chars-regex
```

### [bower](https://bower.io/)

```
bower install non-4byte-chars-regex
```

## API

### non4byteCharsRegex

Type: `RegExp`

```javascript
import non4byteCharsRegex from 'non-4byte-chars-regex';

non4byteCharsRegex.test('foo'); //=> true
non4byteCharsRegex.test('bar🍣baz'); //=> false

non4byteCharsRegex.test('吉'); //=> true
non4byteCharsRegex.test('𠮷'); //=> false
```

## License

[The Unlicense](./LICENSE)

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