But getting <undef> as value
Is your Perl 5.12 or earlier, that is, more than six years old? There apparently was a bug with (?| ) that was fixed in v5.14 (this appears to be the commit). You should consider upgrading.
i am unable to understand regex!
Are you familiar with concepts such as non-capturing groups (?: ) and other basics like \s* etc.? If not, you probably want to read perlretut first. In fact, as far as I can tell even the advanced regex features I used are explained there (with more details on each in perlre):
In reply to Re^3: Splitting a long row with multiple delimiters.
by haukex
in thread Splitting a long row with multiple delimiters.
by dipit
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |