my $RefLine = "(a) This is first line. (b) This is second line; (c) This is different line 32. (d) Here is the last line."; $RefLine =~ /^(\([a-z]\) .+ (?=\([a-z]\)))(.*?)/; print "01\t$1\n02\t$2\n03\t$3\n";