use strict;
my $str = 'R01/10000304603/000/00
2235011: R01/10000304604/000/00
2235021: R01/10000304605/000/00
2235031: R01/10000304606/000/00
2235601: R01/10000304607/000/00
2235611: R01/10000304608/000/00
2235621: R01/10000304610/000/00
2235631: R01/10000304611/000/00
';
my $regex = qr/[\w\d]+\/(\d+)\/\d+\/\d+/mp;
my $subst = '\\t<\\1>\\n\\t\\t\\2\\t</\\1>\\n</\\4>\\n';
my $result = $str =~ s/$regex/$subst/rg;
print "The result of the substitution is' $result\n";
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Perl, please visit: http://perldoc.perl.org/perlre.html