* Creates a clone of `regexp`. * * @private * @param {Object} regexp The regexp to clone. * @returns {Object} Returns the cloned regexp.
(regexp)
| 52296 | * @returns {Object} Returns the cloned regexp. |
| 52297 | */ |
| 52298 | function cloneRegExp(regexp) { |
| 52299 | var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); |
| 52300 | result.lastIndex = regexp.lastIndex; |
| 52301 | return result; |
| 52302 | } |
| 52303 | |
| 52304 | module.exports = cloneRegExp; |
| 52305 |