How do you clone a regular expression in javascript?
I would like to know how to do the following:
- Shallow clone the regex itself, not including properties like
lastIndex
. - Deep clone the regex object, including properties like
lastIndex
.
How do you clone a regular expression in javascript?
I would like to know how to do the following:
lastIndex
.lastIndex
.