// Adding characters to escape for an regex in method Tools::pRegexp()
This commit is contained in:
1 parent
f2fa47772d
commit
cc25088d93
1 file changed
+1
-1
+1
-1
@@ -1832,7 +1832,7 @@ FileETag INode MTime Size
|
|||||||
public static function pRegexp($s, $delim)
|
public static function pRegexp($s, $delim)
|
||||||
{
|
{
|
||||||
$s = str_replace($delim, '\\'.$delim, $s);
|
$s = str_replace($delim, '\\'.$delim, $s);
|
||||||
foreach (array('?', '[', ']', '(', ')', '{', '}', '-', '.', '+', '*', '^', '$') as $char)
|
foreach (array('?', '[', ']', '(', ')', '{', '}', '-', '.', '+', '*', '^', '$', '`', '"', '%') as $char)
|
||||||
$s = str_replace($char, '\\'.$char, $s);
|
$s = str_replace($char, '\\'.$char, $s);
|
||||||
return $s;
|
return $s;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user