2015-02-13 1 views
-4

Это дает ошибку говоря разделители являются неправильными, но я не понимаю, почему:Почему этот шаблон preg_match не работает? (Обнаружение 4 или 5 цифр строк)

preg_match($search_location, "/(\d{4,5})/", $matches); 
+1

Серьезно! Вы посмотрели http://php.net/manual/en/function.preg-match.php? – AbraCadaver

+0

'preg_match ("/(\ d {4,5})/", $ search_location, $ matches);' –

ответ

1

Страница руководства http://php.net/manual/en/function.preg-match.php говорит

int preg_match (string $pattern , string $subject [, array &$matches [, int $flags = 0 [, int $offset = 0 ]]]) 

Вы

preg_match($search_location, "/(\d{4,5})/", $matches); 

Ваши аргументы не в порядке.