Despite its seemingly trivial nature, I am struggling to identify the mistake in my approach. I am attempting to recognize sentence endings by using a regular expression to locate periods. However, I only want to detect periods that follow a word with more than two letters to avoid false positives like "St. Nicholas."
The current expression I am using is:
/\w{3,}\./g
Unfortunately, this pattern seems to be capturing the entire word instead of just the period. What could be the issue here?
UPDATE:
I am looking for
"St. Kitts is really cool. Like seriously, sweet."
To match the periods after both "cool" and "sweet," but not after "St."
UPDATE 2:
Since I am working in Javascript, a standard lookbehind like (?<=text) will not work.