http://qs321.pair.com?node_id=698270

This snipped doesn't add much to the thread...

use strict; use warnings; use Data::Dumper; $Data::Dumper::Sortkeys = 1; my $string = q{AA(aa),AB(a(b),b),AC(Departament d'Astronomia i Astrofí +sica. Universitat de València. C/Dr. Moliner 50, 46100 Burjassot (Val +ència), Spain),AD(a,c,XX(ignored!)),AE(Neumann,AE(+++)),AF(FAILS in r +are case where value contains next token (here:AG),AG(blah)),AG(last) +}; my $range = join(',', 'A'..'Z'); my %result; for (my $key = 'AA'; $key ne 'AAA'; $key++) { # AA..ZZ last if $string !~ /(?:^|\),)$key\(/; # stop if xx( or ),xx( missin +g my $key2 = $key; $key2++; # match AA(...),BB( if ( $string =~ / $key \( (.*?) \) (?: ,$key2\( | $) /x ) { $result{ $key } = $1; } else { #TODO: Error handling warn "No match for $key(...),$key2!\n"; } } print "Result from '$string':\n", Dumper( \%result ), "\n"; __DATA__ $VAR1 = { 'AA' => 'aa', 'AB' => 'a(b),b', 'AC' => 'Departament d\'Astronomia i Astrofísica. Universita +t de València. C/Dr. Moliner 50, 46100 Burjassot (València), Spain', 'AD' => 'a,c,XX(ignored!)', 'AE' => 'Neumann,AE(+++)', 'AF' => 'FAILS in rare case where value contains next token +(here:AG', 'AG' => 'blah)),AG(last' };


... found in a dusty part of the monasteries scriptorium ...

Into this wilde Abyss,
The Womb of nature and perhaps her Grave,
Of neither Sea, nor Shore, nor Air, nor Fire,
But all these in thir pregnant causes mixt
Confus'dly, and which thus must ever fight,
Unless th' Almighty Maker them ordain
His dark materials to create more Worlds,
Into this wilde Abyss the warie fiend
Stood on the brink of Hell and look'd a while,
Pondering his Voyage ...
Milton / Paradise Lost

Darkly fills an otherwise empty scratchpad - and some books by Philip Pullman.