in reply to Performance optimization question

I'd probably try a regex only, but I'm not sure it will improve matters. This code assumes /reg exp/ does not match | characters.
my @results = $string =~ /(?:^|\|)[^|]*(reg exp)[^|]*(?:\||$)/g;
update: adjusted regex. also: sorry for double-post. please reap the above node if you can. the site is amazingly slow today and I can't seem to reach it.