In addition to psini's suggestion of splitting the different semantics in different parts of code, you can also try to keep what you want instead of discarding what you don't want:
# 01:00:00,00:: Col Foo -- Description Scene [Sound=Dolby, Color=y, Li +nk=y, International=y,Budget=total=3343;tax=11%;cost=44444] /^(.*? )\[Sound=(\w+), Color=([yn]), Link=([yn]), International=([yn]) +,Budget=\[total=(\d+);tax=([\d.]+);cost=(\d+)\]$/ or die "Invalid lin +e: >$_<"; print <<OUTPUT; $1 \tSound\t$2 \tColor\t$3 \tLink\t$4 \tInternational\t$5 \tBudget \t\tTotal=$6 \t\ttax=$7 \t\tcost=$8 OUTPUT
If you're using Perl 5.10, I suggest using named captures instead of relying on the numbers to make maintenance more sensible.
In reply to Re: Trying to parse columns with different delimiters.
by Corion
in thread Trying to parse columns with different delimiters.
by magawake
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |