Regex to match . (periods marking end of sentences) but not Mr. (as in Mr. Hopkins)

Posted by Josh Crews on Stack Overflow See other posts from Stack Overflow or by Josh Crews
Published on 2010-05-31T21:31:48Z Indexed on 2010/05/31 21:33 UTC
Read the original article Hit count: 333

Filed under:

I'm trying to parse a text file into sentences ending in periods, but names like Mr. Hopkins are throwing false alarms on matching for periods.

What regex indentfy's "." but not "Mr."

For bonus, I'm also using ! to find end of sentences, so my current Regex is /(!/./ and I'd love an answer that incorporates my !'s too.

© Stack Overflow or respective owner

Related posts about regex

Related posts about regex-negation