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]
|