1 # clone-regexp [![Build Status](https://travis-ci.org/sindresorhus/clone-regexp.svg?branch=master)](https://travis-ci.org/sindresorhus/clone-regexp)
3 > Clone and modify a [RegExp](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp) instance
9 $ npm install --save clone-regexp
16 var cloneRegexp = require('clone-regexp');
22 cloneRegexp(re) === re;
25 cloneRegexp(re, {global: false});
28 cloneRegexp(re, {multiline: true});
31 cloneRegexp(re, {source: 'unicorn'});
38 ### cloneRegexp(regexp, [options])
44 RegExp instance to clone.
50 Properties: [`source`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/source) [`global`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/global) [`ignoreCase`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/ignoreCase) [`multiline`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/multiline) [`sticky`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky) [`unicode`](http://norbertlindenberg.com/2012/05/ecmascript-supplementary-characters/#RegExp)
52 Optionally modify the cloned RegExp instance.
57 MIT © [Sindre Sorhus](http://sindresorhus.com)