Closed SonnyX closed 4 years ago
Yes, it is a bug now in RegExp(otherRegExp) constructor.
Use either one of these:
const re = /\.(\w{3,4})$/;
var ext1 = "https://somedomain.com/somelink.png".match(re)[1];
var ext2 = re.exec("https://somedomain.com/somelink.png")[1];
Since the support for new Regexp(re)
constructor has been removed, closing this issue
I do not quite sure I understand the purpose of such ctor in JS.
Why do you need this:
(new RegExp(/\.(\w{3,4})$/, "gm")).exec("https://somedomain.com/somelink.png")[1];
when you can simply do this
(/\.(\w{3,4})$/gm).exec("https://somedomain.com/somelink.png")[1];
Yet
var ext = "https://somedomain.com/somelink.png" %~ ".";
See "String Operators" in https://sciter.com/docs/content/script/language/Expressions.htm
I agree that there is no use for such a constructor in Javascript. I only saw in your release notes that the constructor is now removed a release, therefor this issue is solved. Solved issues should not remain open, and therefor I closed it.
does not give back
png
for some reason, instead gives an undefined. It should be noted that I'm doing something slightly silly here: namely using a regexp inside a regexp.This works in firefox. Tested with sciter v4.3.0.19 and sciter v4.4.3.21