Extend PHP regex to cover “srcset” and “style” attributes
I was able to use the following regex to cover all tags & attributes with protocols: /<(?:input\b[^<]*\bvalue=[\”\’]https?:\/\/|link\b[^<]*?\brel=[\’\”]canonical[\’\”][^<]*?>)(*SKIP)(*F)|https?:\/\// This is the updated section: # If ‘Relative’ option is selected, remove domain from all internal links $exceptions=”<(?:input\b[^<]*\bvalue=[\”\”]https?:\/\/|link\b[^<]*?\brel=[\’\”]canonical[\’\”][^<]*?>)(*SKIP)(*F)’; if ( $this->option == 2 ) { $website = preg_replace( ‘/https?:\/\//’, ”, home_url() ); $links = preg_replace( “https://wordpress.stackexchange.com/” . $exceptions … Read more