Description: A biogeek's journey through the world of informatics.
Hey there! Thanks for dropping by The Coding Biologist! Take a look around and grab the RSS feed to stay updated. See you around!
Update – 21/01/2012: added non-breaking space, and minimised regex.
/([.!?]|<p[^>]*>)(\s| |<br\s*\/?>)*/ I am using the above regex in a PHP function to find the beginning of a new sentence or paragraph in HTML, as part of a WordPress plugin I’m currently developing. The regex looks for sentence-ending punctuation (.!?) or a paragraph tag, followed immediately by 0 or more white spaces or HTML line break tags.