in Javascript, the following:
var test = ''the quick' 'brown fox' 'jumps over' 'the lazy dog''; var result = test.match(/'.*?'/g); alert(result);
yields ‘the quick’,’brown fox’,’jumps over’,’the lazy dog’
I want each matched element to be unquoted: the quick,brown fox,jumps over,the lazy dog
what regexp will do this?
This seems to work:
Note: This doesn’t match empty elements (i.e. ”). Also, it won’t work in browsers that don’t support JavaScript 1.5 (lookaheads are a 1.5 feature).
See http://www.javascriptkit.com/javatutors/redev2.shtml for more info.