in reply to Re: Splitting a long row with multiple delimiters.
in thread Splitting a long row with multiple delimiters.

Thank you for you efforts! But getting <undef> as value :

Also, please explain more how its working, i am unable to understand regex!

<eab12345> = <undef> <id> = <undef> <pgrp> = <undef> <groups> = <undef> <home> = <undef> <shell> = <undef> <gecos> = <undef> <auditclasses> = <undef> <login> = <undef> <su> = <undef> <rlogin> = <undef> <daemon> = <undef> <admin> = <undef> <sugroups> = <undef> <admgroups> = <undef> <tpath> = <undef> <ttys> = <undef> <expires> = <undef> <auth1> = <undef> <auth2> = <undef> <umask> = <undef> contd........................

Replies are listed 'Best First'.
Re^3: Splitting a long row with multiple delimiters.
by haukex (Archbishop) on Jan 21, 2018 at 13:35 UTC
    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):