I may be missing something, but this seems to be all about appropriately transforming in-place the & | characters (and any surrounding whitespace). Nothing needs to be extracted.
Script:
use warnings; use strict; print qq{running under Perl version: $] \n\n}; my $str = <<EO_STR; must-column08:Submit & must-column10:Delivered must-column08:Submit & must-column10:Delivered One & must-column9:No_e +rror must-column08:See Here & must-column10:Delivered | must-column9:No_err +or EO_STR print qq{<<$str>>}; print qq{\n\n}; $str =~ s{ \s* ([&|]) \s* }{\n$1\n}xmsg; print qq{[[$str]]};
Output:
c:\@Work\Perl\monks\ravi45722>perl xform_str_1.pl running under Perl version: 5.008009 <<must-column08:Submit & must-column10:Delivered must-column08:Submit & must-column10:Delivered One & must-column9:No_e +rror must-column08:See Here & must-column10:Delivered | must-column9:No_err +or >> [[must-column08:Submit & must-column10:Delivered must-column08:Submit & must-column10:Delivered One & must-column9:No_error must-column08:See Here & must-column10:Delivered | must-column9:No_error ]]
Give a man a fish: <%-{-{-{-<
In reply to Re: Regex : Return match elements
by AnomalousMonk
in thread Regex : Return match elements
by ravi45722
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |