tedious / JShrink

Javascript Minifier built in PHP
http://www.tedivm.com
BSD 3-Clause "New" or "Revised" License
749 stars 152 forks source link

Unclosed regex pattern at position: 2327651 #142

Open zaitebaki opened 9 months ago

zaitebaki commented 9 months ago

I get the error

"Uncaught: Unclosed regex pattern at position: 2327651"

when using the JavaScript code:

let jj = jid.match(/([^/]+)(?:\/(.+))?/);

If I replace the code like this:

const regex = new RegExp("([^/]+)(?:\/(.+))?");
let jj = jid.match(regex);

the error disappears, and everything works as expected.