Javascript: what’s the point of RegExp.compile()?

The RegExp().compile() method is deprecated. It’s basically the same as the constructor, which I assume is why it was deprecated. You should only have to use the constructor nowadays.

In other words, you used to be able to do this:

var regexp = new RegExp("pattern");
regexp.compile("new pattern");

But nowadays it is not any different from simply calling:

var regexp = new RegExp("pattern");
regexp = new RegExp("new pattern");

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)