0.1.0 • Published 2 years ago
regexp-flags-upfront v0.1.0
regexp-flags-upfront
Make regexps from a string that contains the flags as well as the pattern.
API
This module exports one function:
makeRegExp(spec, addFlags)
Where spec
is your RegExp pattern, with a catch: If it starts with an
expression like (?imu:)
, its letters will be used as the RegExp flags.
If addFlags
is given, it should be an empty string or a string of only
letters. They will be merged with the flags possibly found in spec
.
Known issues
- Needs more/better tests and docs.
License
ISC
0.1.0
2 years ago