regex - php preg_match_all conditional pattern -
the php pattern regex syntax stuff gives me headaches... i'm trying match javascript tags except js tags id="pagespeed", can move them somewhere else. need pattern condition, else done.
i'm having this:
$jspattern = '#<script.*</script>#isum';
which finds tags, , need check exceptional condition not true. should like:
~^<script.+id=\"pagespeed\".*</script>]~
the line wrong , needs combined line above. great if me seem suck @ pcre syntax :(
i use @casimir's answer purpose.. if looking regex.. use below pattern:
<script[^>]*id="(?!pagespeed\b)[^"]+".*<\/script>
see demo
Comments
Post a Comment