I've searched several places for an answer to this, but haven't found one, so here goes:
I have a string that looks something like this:
abcd('blah','blahblah','blee')
and I want a regexp to match and return everything inside two single quotes. In this case, blah, blahblah, and blee. There are two case that are giving me problems. The first is I don't want an escaped quotation to trip it off. So, I used this:
/[^\\]'(.*?[^\\])'/
which works beautifully. The only problem is EMPTY strings. Say I have
abcd('','blah','blahblah','blee')
Well, that previous regexp blows up because it returns the character before the second quotaion, which is the previous quotation.
Any ideas on how I can solve this?
I have a string that looks something like this:
abcd('blah','blahblah','blee')
and I want a regexp to match and return everything inside two single quotes. In this case, blah, blahblah, and blee. There are two case that are giving me problems. The first is I don't want an escaped quotation to trip it off. So, I used this:
/[^\\]'(.*?[^\\])'/
which works beautifully. The only problem is EMPTY strings. Say I have
abcd('','blah','blahblah','blee')
Well, that previous regexp blows up because it returns the character before the second quotaion, which is the previous quotation.
Any ideas on how I can solve this?