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