在php中匹配未转义字符
在PHP中,我需要一个regexp来只匹配字符串中的单个/在php中匹配未转义字符,php,regex,Php,Regex,在PHP中,我需要一个regexp来只匹配字符串中的单个/ "bla bla bla/bla bla bla" //The regexp must match the / character "bla bla // bla bla / bla bla" //The regexp must match only the last / not the first beacuse it is followed by another / 因此,我只希望您可以使用unescaped/来完成此操作 {(?
"bla bla bla/bla bla bla" //The regexp must match the / character
"bla bla // bla bla / bla bla" //The regexp must match only the last / not the first beacuse it is followed by another /
因此,我只希望您可以使用unescaped/来完成此操作
{(?)?
这与a/匹配,但前提是不在前面加上另一个,也不在后面加上另一个/
$escaped=preg_replace('{(?<!/)/(?!/)}', '//', $original);
$escape=preg_replace({(?您可以用于此
{(?)?
这与a/匹配,但前提是不在前面加上另一个,也不在后面加上另一个/
$escaped=preg_replace('{(?<!/)/(?!/)}', '//', $original);
$escape=preg_replace('{(?)?