I am trying to write a regular expression in javascript for finding if any words in a sentence start with a particular phrase. Eg, I'd like to know if "by" is contained at the beginning of any word in the following sentence : "The Tipping Point by Malcolm Gladwell".
I tried using \b
but /\bsor/
will match a sentence like 'Mary's organ is broken.' ie it treats punctuation as a word boundary and starts matching after them.
Any thoughts?