use strict;
my $str = 'WRF 9a-5p
WR 9-10:15a
WR 7:15-8:45p
WF 9a-12:10p
WF 9:30-11:30a
WF 8-10:45a
WF 12-2:45p
Su 9a-6p
WF 10-11:50a
W 9a-12p
W 9a-12p
W 9a-12:20p
W 9a-12:20p
W 9a-12:20p
W 9:30a-4:45p';
my $regex = qr/^(\s*(?:Su|M|Tu|W|Th|F|S|R))((?:Su|M|Tu|W|Th|F|S|R){1,2})(.*)/mp;
my $subst = '$1$3\\n$2$3';
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