Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

available-regexp-flags

inspect-js13.7kMIT1.0.4TypeScript support: included

Which regular expression flags does the current environment support?

regexp, regular expression, regex, flags, global, ignoreCase, multiline, sticky, unicode, dotAll, hasIndices, unicodeSets

readme

available-regexp-flags Version Badge

github actions coverage License Downloads

npm badge

Which regular expression flags does the current environment support?

Example

var flags = require('available-regexp-flags');
var properties = require('available-regexp-flags/properties');

flags.forEach((flag) => {
    assert.doesNotThrow(() => {
        const r = new RegExp('foo', flag);

        var propertyName = properties[flag];
        assert.equal(r[propertyName], true);
    });
});

Tests

Simply clone the repo, npm install, and run npm test