is-supported-regexp-flag

1.0.1 • Public • Published

is-supported-regexp-flag Build Status

Check whether a RegExp flag is supported. Mostly useful for y and u.

Install

$ npm install --save is-supported-regexp-flag

Usage

var isSupportedRegexpFlag = require('is-supported-regexp-flag');
 
isSupportedRegexpFlag('g'); // as in /foo/g
//=> true
 
isSupportedRegexpFlag('u');
//=> false

RegExp throws if you're trying to use unsupported flags. This is a nicer way to check for support.

License

MIT © Sindre Sorhus

install

npm i is-supported-regexp-flag

Downloadsweekly downloads

489,312

version

1.0.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability