in reply to Re^2: split on commas
in thread split on commas

With comments:
$_ = "<*2>FOO<2,1>,<*3>(SigB<8:0:2>,BAR),<*2>Siga<2:0>,Sigb<8,7,6,5,0> +"; @line = split(/ , # comma... (?! # not followed by [\w,]+ # "word" characters or commas and [>)] # a close-bracket or close-paren ) /x, $_); print join($/, @line), $/;

Replies are listed 'Best First'.
Re^4: split on commas
by pip9ball (Acolyte) on Jun 05, 2009 at 22:12 UTC
    Thanks!
      the problem with this approach is that it erroneously accepts input such as
      $_ = "<*2)FOO<2,1>,<*3>(SigB<8:0:2>,BAR),<*2>Siga<2:0>,Sigb<8,7,6,5,0> +";
      (where the first < matches a )

      you really need a parser to do this kind of thing "right".