#! perl -slw use strict; my $data = do{ local $/; }; print "'$1'$2'\n" while $data =~ m[([a-z-]+):(.*?)\n(?=[a-z-]+:|$)]sg; __DATA__ aut-num: AS19710 as-name: ASN descr: S4R admin-c: SNE1 tech-c: SNE1 import: from AS3356 63.215.71.1 at 63.215.71.2 action pref=20; med=50; from AS3356 63.215.86.133 at 63.215.86.134 action pref=50; med=150; accept ANY import: from AS3847 action pref=10; accept ANY export: to AS3847 announce AS19710 export: to AS3356 announce AS19710 notify: nwcontact@email mnt-by: S4R changed: andy@email 20010502 source: LEV #### P:\test>448390 'aut-num' AS19710' 'as-name' ASN' 'descr' S4R' 'admin-c' SNE1' 'tech-c' SNE1' 'import' from AS3356 63.215.71.1 at 63.215.71.2 action pref=20; med=50; from AS3356 63.215.86.133 at 63.215.86.134 action pref=50; med=150; accept ANY' 'import' from AS3847 action pref=10; accept ANY' 'export' to AS3847 announce AS19710' 'export' to AS3356 announce AS19710' 'notify' nwcontact@email' 'mnt-by' S4R' 'changed' andy@email 20010502' 'source' LEV'