Assumes no tag nesting:
my %data; while (/\[:([^\]]+)\](.+)\[:\1\]/gis) { $data{$1} = $2; }
Update: Added missing /g
In reply to Re: Reduce amount of duplicated code
by ikegami
in thread Reduce amount of duplicated code
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |