Anyway, I am adapting a product that seems to require a preg_match and I'm not sure why. It uses this javascript:
Code: Select all
<script language="JavaScript">
<!--
function WriteBack(form_name,field_name,text)
{
opener.document[form_name][field_name].value = text;
}
-->
</script>Code: Select all
$str = preg_replace("/('|\"|\\\\|\r|\n)/", "\\\\\$1", $str);In the first parameter the forward slashes are delimiters, I got that much, but what is all the rest? And what is the replacement string? Is $1 some kind of constant? Because I see it nowhere in the code. Will the js not work if there are newlines?
I will take all the help I can get, here.