Not really. Didn't want to hit performance that hard for so simple task. But it makes me think, maybe provide something like .clone() method for cloning the already constructed RegExp and extending it later?
.clone()
You wouldn't hit it as hard as you think, since in the absence of mutable methods you would reuse most of the tree.
In this case, I will consider it as an option. Of course it would be quite a breaking change.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Not really. Didn't want to hit performance that hard for so simple task. But it makes me think, maybe provide something like
.clone()
method for cloning the already constructed RegExp and extending it later?You wouldn't hit it as hard as you think, since in the absence of mutable methods you would reuse most of the tree.
In this case, I will consider it as an option. Of course it would be quite a breaking change.