is-supported-regexp-flag
Check whether a RegExp flag is supported. Mostly useful for `y` and `u`.
Last updated 7 years ago by sindresorhus .
MIT · Repository · Bugs · Original npm
$ cnpm install is-supported-regexp-flag 
SYNC missed versions from official npm registry.

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

Current Tags

  • 1.0.1                                ...           latest (7 years ago)

1 Versions

  • 1.0.1                                ...           7 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (1)
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org