This seems too simple, which makes me suspicious that I've missed something?
$data = "five[5]=12345&ten[12]=12345=678=90&six[6]=123456"; $hash{ $1 } = $2 while $data =~ m/ ( [a-z]+ ) \[ \d+ \] = (.*?) (?= (?: & [a-z]+ \[ ) | $ ) /gx; print Dumper \%hash;; $VAR1 = { 'six' => '123456', 'five' => '12345', 'ten' => '12345=678=90' };
In reply to Re: splitting string based on length index
by BrowserUk
in thread splitting string based on length index
by phi95aly
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |