Using preg_replace, I would like to replace all instances of a "pipe not followed by http://", If the pipe is followed by http://, then do nothing. For example,
The following string:
http://www.xyz.org/docs/pdfs/2014/file_name_1.pdf|file_name_2.pdf|http://www.xyz.org/docs/pdfs/2014/file_name_3.pdf|
Once run thru preg_replace will become:
http://www.xyz.org/docs/pdfs/2014/file_name_1.pdf|http://www.xyz.org/docs/pdfs/2014/file_name_2.pdf|http://www.xyz.org/docs/pdfs/2014/file_name_3.pdf|
The code I have in place so far replaces all pipes.
$string = trim(preg_replace("/\|\|+/", "|", $string));
$string = str_replace("|", "|http://www.xyz.org/docs/pdfs/2014/", $string);