Regular Expression – remove quotes from HTML attributes that does not contain spaces but keep quotes around URLs
I’m trying to simplify HTML and JS for my page, and have problem with regular expression: $replace = [ …, ‘~([rnt ])?([a-zA-Z0-9]+)=”([a-zA-Z0-9_/\-]+)”([rnt ])?~s’ => ‘$1$2=$3’]; $scripts = preg_replace(array_keys($replace), array_values($replace), $scripts); $html = preg_replace($searchh, $replacee, $html); But in case of expression… Read More »Regular Expression – remove quotes from HTML attributes that does not contain spaces but keep quotes around URLs