Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Erik Römmelt 9dab5e2dbc Update Node_modules 5 years ago
..
test Update Node_modules 5 years ago
.travis.yml Update Node_modules 5 years ago
History.md database and ajax test added 5 years ago
LICENSE database and ajax test added 5 years ago
Makefile database and ajax test added 5 years ago
README.md Update Node_modules 5 years ago
index.js Update Node_modules 5 years ago
package.json Update Node_modules 5 years ago

README.md

regexp-clone

==============

Clones RegExps with flag and lastIndex preservation.

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