$xml = '
write
crlf
loading
| |
lemmas
| |
for
| |
<lx>
| |
onto
| |
<lms>
';
$xml =~
s&
.
write.
crlf
(.<(?:symConstant|variable)>[^<]*(?:symConstant|variable)>)+.
&
my $text;
foreach my $expr (1..$#-) {
$text .= ${$expr};
}
$text =~ s#crlf#\\n#;
$text =~ s#?symConstant>##sg;
$text =~ s#?variable>##sg;
$text =~ s#.\| \|.# #sg;
"";
&xse;
print $xml;