fork(2) download
  1. $_ = "\n\n" . join /\n/, <main::DATA>;
  2. 1 while s/^(.*?\n?)\n{1,2}\s*([^\d]+)\s+(\d+)\s*?(?:\s*and|[,\n\s])(.*?)(?<=\n)(\3\s+)([^\n]*)(\n.*$|$)/$1$2 - $6\n\n$4$5$6$7/gs;
  3. s/\n\n.*$//s;
  4. print $_;
  5.  
  6. __DATA__
  7. Aa Aaa 1, Bb Bbb 2 and Cc Ccc 1
  8. 1 Institut xx Xx, Some University, Xxxx 14, US-10000 NewYork, USA; E-Mails: aa.aaa@edu.com; cc.ccc@edu.com
  9. 2 Institut zz Zzz, Some University2, Zzzz 20, US-10000 NewYork, USA; E-Mail: bb.bbb@edu.com
Success #stdin #stdout 0s 4552KB
stdin
Standard input is empty
stdout
Aa Aaa - Institut xx Xx, Some University, Xxxx 14, US-10000 NewYork, USA; E-Mails: aa.aaa@edu.com; cc.ccc@edu.com 
Bb Bbb - Institut zz Zzz, Some University2, Zzzz 20, US-10000 NewYork, USA; E-Mail: bb.bbb@edu.com
Cc Ccc - Institut xx Xx, Some University, Xxxx 14, US-10000 NewYork, USA; E-Mails: aa.aaa@edu.com; cc.ccc@edu.com