Syntactic Confectionery Delight | |
PerlMonks |
Re^3: Match last word in a sentenceby parv (Parson) |
on Aug 14, 2021 at 01:39 UTC ( [id://11135835]=note: print w/replies, xml ) | Need Help?? |
Is making the first part non-greedy not enough ...
... (would it fail on some other string)? Much later. For English language, \w is not inclusive enough (lacks hyphen) and includes too much (includes underscore & digits). Short of a proper grammar based parser, I would rather use word regex which addresses that ...
... is still incomplete as it does not deal with accented characters; periods in a title; acronyms with spaces and/or periods, among other things.
In Section
Seekers of Perl Wisdom
|
|