помогите с preg_match выдает ошибку но работает

Petrrrr

Новичок
вот такую штуку написал
$column['G'] = '131384 132484 WIL133765';
$columnB = 'WIL133765';
if (!preg_match('/\b'.$columnB.'\b/i', $column['G'])) {
$column['G'] .= $columnB.' ';
}

вобщем если в строке находит $columnB то не добавлять к строке, если не находит то добавляет

и такая ошибка
PHP Warning: preg_match() [<a href='function.preg-match'>function.preg-match</a>]: Delimiter must not be alphanumeric or backslash in

вобще так можно делать !preg_match('/\b'.$columnB.'\b/i', $column['G'])

я только учусь
или может разбить строку на массив и перебрать в цикле ведь известно что между номерами только один пробел
 

WMix

герр M:)ller
Партнер клуба
Код:
$ php -a
Interactive mode enabled

php > $column['G'] = '131384 132484 WIL133765';
php > $columnB = 'WIL133765';
php > if (!preg_match('/\b'.$columnB.'\b/i', $column['G'])) {
php { $column['G'] .= $columnB.' ';
php { }
php > print_r($column);
Array
(
    [G] => 131384 132484 WIL133765
)
php >
возможно это
http://php.net/manual/de/function.preg-quote.php
 
Сверху