My Regex doesn't work :
-- Without modifiers removing "https://www." in the console works. But I want more. -- With especially groups ([a-zA-Z]+ and/or modifier (+?), my original string is not matched.
WORKS query = https://www.
DOESN'T WORK https://www.[a-zA-Z]+.
DOESN'T WORK https?://www.
Sample string :
var text = `
hi max, I have a big link to share, it's https://www.test.com/?q=what&sz=48x48.
What do you think ?
`;
WORKS
text = text
.replace("max","bob")
.replace('https://www\.',"");
DOESN'T WORK
.replace("max","bob")
.replace('https?://www\.[a-zA-Z]+\.[a-zA-Z]+\/?',"");```