let str = "https://img.codeshelper.com/upload/img/2021/03/02/y5ok3jewrp52423.jpg http://www.qqe.com/qwe/qwe.JPG"
console.log (str.match (/ (? < = ^ | .jpg) (. +?) .jpg / g));
the requirement is to cut the URL in array
use match (/? < = ^ | .jpg) (. +?) .jpg/ig) to cut
No problem in chrome, but errors will be reported in firefox and safari
firefox error message is SyntaxError: invalid regexp group
safari error message is Invalid regular expression: unrecognized character after (?
checked that it is possible that js does not support it? < =
how to rewrite this paragraph is better?
or if you have a better way to cut strings, you can also put forward
.