Subject: | Improvement to first sentence matching |
Text-Original-1.2
The first sentence is matched from the first paragraph with a regexp of:
$text =~ s/([.?!]).*/$1/s;
I would suggest that it may be better to look for a space following the terminating character:
$text =~ s/([.?!]) .*/$1/s;
I came across this when the first sentence read "In file.txt editÂ…" and only got "In file." as the first sentence.
Thanks
Matthew