<?php $pattern = "~\\.(?=[^']*'(?:$|;))~i"; $replacement = "\\x2e"; $subject = "window.location.href='.www.test.test.com.'; window.location.href='.www.test.test.com.';";
Standard input is empty
window.location.href='\x2ewww\x2etest\x2etest\x2ecom\x2e'; window.location.href='\x2ewww\x2etest\x2etest\x2ecom\x2e';