I’m trying to count words using Regex, with the following pattern:
@"\\w+"
This works, however it’s matching it’s as:
- it
- s
Is there a better way to match words that contain punctuation?
Also, words surrounded by punctuation, for example 'word' should also be matched (withhout the ‘)
The one way to test for such cases is:
So it will match both
itsandit's, but onlyitsinits'.