This keeps the punctuation with the "sentence" so you don't have to keep track of what it was.... i.e. you can join with '', not with '.'sub get_nsentences { my $text = shift; my $count = shift || 1; join '', ($text =~ /.*?[\.!?]/sg)[0..$count-1] }
-Blake
In reply to Re: Re: Retreaving N first sentences from text.
by blakem
in thread Retreaving N first sentences from text.
by c0d34w4y
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |