1 /** Used to match `RegExp` flags from their coerced string values. */
5 * Creates a clone of `regexp`.
8 * @param {Object} regexp The regexp to clone.
9 * @returns {Object} Returns the cloned regexp.
11 function cloneRegExp(regexp) {
12 var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
13 result.lastIndex = regexp.lastIndex;
17 module.exports = cloneRegExp;