Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- preg_split lookbehind assertion
March 25, 2007, 12:11 am
rate this thread
I want to split a string where | delimits a line. I want to use a look
$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.