preg_match(”[\\]“, $somedatawithbackslash);
throws exception: Warning: preg_match() [function.preg-match]: No ending matching delimiter \’]\’ found
preg_match(’/\\\\/’, $somedatawithbackslash);
throws exception: Warning: preg_match() [function.preg-match]: No ending matching delimiter \’]\’ found
preg_match('#\\#, $somedatawithbackslash);
throws exception: Warning: preg_match() [function.preg-match]: No ending delimiter \'#\' found
php...is so uerfriendly...pft
help?
Here is a test case:
<?php
$data = "<html xml:lang=\"en-US\"";
if (preg_match('/\\\\/', $data))
{
$data = preg_replace('/\\\\/', '', $data, -1, $count);
if ($count < 1)
{
print 'failed';
}
print "Replaced $count times: result: $data";
}
else
{
print 'failed to match anything';
}
?>