1234567891011121314
#!/usr/bin/perluse strict;my $string = "Das ist Martin: [BILD=martin.gif NAME=test NAME2=hallo]";my @values = $string =~ m!\[(?:(\w+?)\s*=\s*(.+?)\s*)+\]!gs;&parse(@values) if scalar @values;sub parse { my %params = @_; print $_ . " = ".$params{$_}."\n" for keys %params;}
NAME2 = hallo