I am using regex to match css values.
Input string to match
font-size:25px;font-family:georgian;content:"' unicode given in pseudo © '";
Regex I am using to match
/.*\bcontent:(\s*[^;]*)/
I am using $1 to get the actual string output of regex
Expected output is "' unicode given in pseudo © '"**
But actual is "' unicode given in pseudo ©
Because regex finds ; in the content value so it breaks there.
So how can i fix this bug.
Ideally regex should look for the last ; which is not inside the double/single quotes. Because my input string will always have ; after each property value ends.
Thanks
/.*\bcontent:\s*(.*);/to match up to the last;char on a line. Or just/\bcontent:\s*"([^"]*)";/(demo)\bcontent:\s*(".*?");, see this demo.