[ICO]NameLast modifiedSizeDescription
[PARENTDIR]Parent Directory  -  
[DIR]test/2023-06-08 14:13 -  
[TXT]History.md1985-10-26 08:15 59  
[   ]Makefile1985-10-26 08:15 76  
[   ]index.js1985-10-26 08:15 698  
[TXT]README.md1985-10-26 08:15 955 0fb859dc fixed mobile overflwo options [كارل مبارك]
[   ]LICENSE1985-10-26 08:15 1.1K0fb859dc fixed mobile overflwo options [كارل مبارك]
[   ]package.json2023-06-08 14:14 1.4K 
#regexp-clone
==============

Clones RegExps with flag and `lastIndex` preservation.

```js
const regexpClone = require('regexp-clone');

const a = /somethin/misguy;
console.log(a.global); // true
console.log(a.ignoreCase); // true
console.log(a.multiline); // true
console.log(a.dotAll); // true
console.log(a.unicode); // true
console.log(a.sticky); // true

const b = regexpClone(a);
console.log(b.global); // true
console.log(b.ignoreCase); // true
console.log(b.multiline); // true
console.log(b.dotAll); // true
console.log(b.unicode); // true
console.log(b.sticky); // true

const c = /hi/g;
c.test('this string hi there');
assert.strictEqual(c.lastIndex, 3);

const d = regexpClone(c);
assert.strictEqual(d.lastIndex, 3);
d.test('this string hi there');
assert.strictEqual(d.lastIndex, 14);
assert.strictEqual(c.lastIndex, 3);
```

```
npm install regexp-clone
```

## License

[MIT](https://github.com/aheckmann/regexp-clone/blob/master/LICENSE)