my $data = qq[ this is some text. A period (".") usually terminates a statement. But not if it is quoted. Regardless of whether or not single quotes, '.', are used. And yes, "Mr. Ovid," even lines with a period in the middle of a quote. ]; my $doublequoted = qr/"[^"\\]*(?:\\.[^"\\]*)*"/m; my $singlequoted = qr/'[^'\\]*(?:\\.[^'\\]*)*'/m; my $sentence = qr/ (?: $singlequoted | $doublequoted | [^.] )* \. /xm; my @items = $data =~ /($sentence)/g; print "[$_]\n" for @items; #### my $float = qr/\d+\.\d+/; my $sentence = qr/ (?: $float | $singlequoted | $doublequoted | [^.] )+ \. /xm; $data .= "g = 9.8 m/s.";