I'm getting nowhere with this...
I need to test a string if it contains %2
and at the same time does not contain /
. I can't get it to work using regex. Here is what I have:
var re = new RegExp(/.([^\/]|(%2))*/g);
var s = "somePotentially%2encodedStringwhichMayContain/slashes";
console.log(re.test(s)) // true
Question:
How can I write a regex that checks a string if it contains %2
while not containing any /
slashes?