non-4byte-chars-pattern

0.0.1 • Public • Published

non-4byte-chars-pattern

NPM version Bower version Build Status Coverage Status dependencies Status devDependencies Status

import non4byteCharsPattern from 'non-4byte-chars-pattern';
 
const input = document.createElement('input');
input.setAttribute('pattern', non4byteCharsPattern);
 
input.value = 'Hello (^ ^)';
input.validity.patternMismatch; //=> false
 
input.value = 'Hello 🤗';
input.validity.patternMismatch; //=> true

Installation

npm

npm install non-4byte-chars-pattern

bower

bower install non-4byte-chars-pattern

API

non4byteCharsPattern

Type: String

Note that this pattern regards an empty string '' as valid. If you want to disallow blank input, use required attribute instead.

Related project

non-4byte-chars-regex - RegExp version of this module

License

The Unlicense.

Package Sidebar

Install

npm i non-4byte-chars-pattern

Weekly Downloads

911

Version

0.0.1

License

Unlicense

Last publish

Collaborators

  • shinnn