You are here: preg_split lookbehind assertion « PHP Programming Language « IT news, forums, messages
preg_split lookbehind assertion

Posted by darius on 03/25/07 00:11

hi

I want to split a string where | delimits a line. I want to use a look
behind assertion

$txt = 'hello\|there|how|is|it|going';
$re = '/(?<!\\)\|/';
print_r ( preg_split($re, $txt));


I mean to say with the $re: match '|' that is not preceded by a '\'

however, when run, I get

preg_split(): Compilation failed: missing ) at offset 8

what am I doing wrong? thanks.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация