fork(1) download
  1. <?php
  2.  
  3. $pattern = "~\\.(?=[^']*'(?:$|;))~i";
  4. $replacement = "\\x2e";
  5. $subject = "window.location.href='.www.test.test.com.'; window.location.href='.www.test.test.com.';";
  6. echo preg_replace($pattern, $replacement, $subject);
Success #stdin #stdout 0.02s 52432KB
stdin
Standard input is empty
stdout
window.location.href='\x2ewww\x2etest\x2etest\x2ecom\x2e'; window.location.href='\x2ewww\x2etest\x2etest\x2ecom\x2e';