If you're just looking for a regex that does this, then won't /"/g
just work fine? So, in JavaScript...
var str = 'window.location="mailto:"+this.innerHTML.split("").reverse().join("");';
// you can get this string from anywhere.
str.match(/"/g);
// returns an array of quotes whose length is equal to the # of quote characters found.
That will be less than useful but you have not said what you want to do with it.
Or, if you want to get everything that is in quotes, use the regex /"(.*?)"/g
.
Explanation:
- Matches a quote character
- Does a lazy match for any character
- Stops at the next quote character.
There's a capture group already provided to do useful things with.