Match text between double or single quotes

Viewed 1227

I need some regex help. I have been banging my head on this last few hours. I need to match some strings in a minified file.

Sample string:

var a ='abc'; var b = 'http://a/that.dude.js/v1/'; var c = 'def'; var d = 'https://b/that.dude.js/v1/';
var basePath = "http://othersite/that.dude.js/v1/";

I want to match full text inside single or double quotes that contains that.dude.js/v1. I tried:

/('|").+that.dude.js\/v1\/('|")/g

...but this matches the full line when there are multiple occurrences in the same line.

My expected match will be:

http://a/that.dude.js/v1/
https://b/that.dude.js/v1/
http://othersite/that.dude.js/v1/

Here is what I have tried: http://regexr.com/3cv62

2 Answers
Related