reginald
Clone and modify a RegExp instance, including removing, prepending, appending & replacing the source
Reginald is based on clone-regexp by sindresorhus. Reginald adds source manipulation functionality on top of what clone-regexp offered
Install
$ npm i -S reginald
Usage
var reggie = ;var re = /[a-z]/gi; ;//=> /[a-z]/gi === re;//=> false ;//=> /[a-z]/i ;//=> /[a-z]/gim ;//=> /wombat/gi //=> /b/ //=> /b/ //=> /ba/ //=> /ab/ //=> /a/
API
reggie(regexp, [options])
regex
Type: regexp
RegExp instance to clone.
options
Type: object
Properties: source
global
ignoreCase
multiline
sticky
unicode
Optionally modify the cloned RegExp instance.
License
MIT © Sindre Sorhus MIT © James Womack