i need some help with a RegEx that should split cssText( not selector,but the part inside {} ) into assoc with key->value pairs array in PHP
Assuming the the selector part is removed and there is for instance this:
color: black;
font-family: \"Courier New\";
background: url(\"test.png\");
color: red;
Yes the string is escaped i did managed to do that when extracting the {} part.
BUT:
if background is dataURI or there is content prop set like those:
content:'1.test;2.blabla;';
background: white url('data:image/png;base64,iVBORw0KGgoAA
AANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABl...') no-repeat scroll left top;
the splitting RegEx i use:
preg_match_all('/([\w-]+)\s*:\s*([^;]*)\s*;?/i', $css, $matches, PREG_SET_ORDER);
fails :(
I'm not pro in RegEx and need your advice on how to NOT brake on ';' appearance inside \"...\" inside the string.
It should be in the capturing group ([^;]*) which as i found means: Match any single character that is not ; and repeat that 0 or more times.
Thanks in advance!