() is also a valid delimiter

This commit is contained in:
Wouter J 2014-02-20 16:15:12 +01:00
parent 7ac17be3ae
commit b7519c7727

View File

@ -65,7 +65,11 @@ class Regex implements ValueInterface
$start = substr($m[1], 0, 1);
$end = substr($m[1], -1);
if (($start === $end && !preg_match('/[*?[:alnum:] \\\\]/', $start)) || ($start === '{' && $end === '}')) {
if (
($start === $end && !preg_match('/[*?[:alnum:] \\\\]/', $start))
|| ($start === '{' && $end === '}')
|| ($start === '(' && $end === ')')
) {
return new self(substr($m[1], 1, -1), $m[2], $end);
}
}