I have this regex:
//remove quotes from HTML attributes that does not contain spaces; keep quotes around URLs
var $result = preg_replace('/((\S)+\s*(?<!href)(?<!src)(=)\s*)(\"|\')(\S+)(\"|\')/','$1$5', $string);
It's almost working as intended, I just need to adapt it with an additional exception: allow remove quotes from "src" attributes of "img" tags.
Could please someone give me a tip? Any help would be greatly appreciated.