in reply to Grabbing anything between pipe delimiters
To solve your problem without answering the question:
Using regexps is possible, but, given your requirements, sounds like the wrong solution. Something like this would work, but I'd still suggest split.my @fields = split /\|/, $line;
my @a = $line =~ /([^\|]+)\|?/g;
|
|---|