So, I have a JavaScript regexp like this:
/url:.?(['"])(https?:\/\/.*?)\1/
I use it to find specific url inside html/js code. As you can see I capture link inside either ''
or ""
.
This is a problem, because I don't want to get links like 'http://'.
/url:.?(['"])(https?:\/\/.+)\1/
This also picks stuff like 'http://"+d+', also bad.
I'd like to be able to say in the regex something like this:
/(['"])(https?:\/\/[^\1]+)\1/
To use [^\1] instead of a dot, to only get whatever is inside '' or "", making sure it does not pick up 'http://"+d+'
Is there a way to do stuff like this?