I want to extract the first n words of a string. The expression I have is the following (for extracting five words)It works OK if there are no punctuation signs, but doesn't work if there are, i.e. if $out is "The Victoria Yoga Centre Society is bla bla bla" then it works, if it is "Producing & selling of yogaprops like bla bla bla" does not work
How should I modify the above statement to simply ignore punctuation signs?
Thanks a lot.
Ivan
-----
Iyengar Yoga Resources / GT Plugins
Code:
$out =~ s/^((\w*\s){5})(.*)/$1/;How should I modify the above statement to simply ignore punctuation signs?
Thanks a lot.
Ivan
-----
Iyengar Yoga Resources / GT Plugins