I wanted to write a regular expression to match strings enclosed in single quotes, but should not match a string with a single quotation mark enclosed in double quotation marks.
Example 1:
a = 'This is a single-quoted string';
the whole value of a must match because it is enclosed in single quotes.
EDIT: The exact match should be:
'This is a one-line string
Example 2:
x = "This is a 'String' with single quote";
x should not return any match because single quotes are inside double quotes.
I tried /'.*'/g , but it also matches a single quote inside a double quote string.
!
EDIT:
:
The "quick 'brown' fox" jumps
over 'the lazy dog' near
"the 'riverbank'".
:
'the lazy dog'