Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/inspect-js/available-regexp-flags
Which regular expression flags does the current environment support?
https://github.com/inspect-js/available-regexp-flags
dotall flags global hasindices ignorecase multiline regex regexp sticky unicode unicodesets
Last synced: 2 months ago
JSON representation
Which regular expression flags does the current environment support?
- Host: GitHub
- URL: https://github.com/inspect-js/available-regexp-flags
- Owner: inspect-js
- License: mit
- Created: 2022-01-13T23:27:24.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-03-11T04:21:58.000Z (10 months ago)
- Last Synced: 2024-08-10T11:26:44.897Z (5 months ago)
- Topics: dotall, flags, global, hasindices, ignorecase, multiline, regex, regexp, sticky, unicode, unicodesets
- Language: JavaScript
- Homepage:
- Size: 56.6 KB
- Stars: 6
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# available-regexp-flags [![Version Badge][npm-version-svg]][package-url]
[![github actions][actions-image]][actions-url]
[![coverage][codecov-image]][codecov-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url][![npm badge][npm-badge-png]][package-url]
Which regular expression flags does the current environment support?
## Example
```js
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`[package-url]: https://npmjs.org/package/available-regexp-flags
[npm-version-svg]: https://versionbadg.es/inspect-js/available-regexp-flags.svg
[deps-svg]: https://david-dm.org/inspect-js/available-regexp-flags.svg
[deps-url]: https://david-dm.org/inspect-js/available-regexp-flags
[dev-deps-svg]: https://david-dm.org/inspect-js/available-regexp-flags/dev-status.svg
[dev-deps-url]: https://david-dm.org/inspect-js/available-regexp-flags#info=devDependencies
[npm-badge-png]: https://nodei.co/npm/available-regexp-flags.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/available-regexp-flags.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/available-regexp-flags.svg
[downloads-url]: https://npm-stat.com/charts.html?package=available-regexp-flags
[codecov-image]: https://codecov.io/gh/inspect-js/available-regexp-flags/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/inspect-js/available-regexp-flags/
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/available-regexp-flags
[actions-url]: https://github.com/inspect-js/available-regexp-flags/actions