Need to capitalize the first letter of each word in a sentence, my regex expression however is also capitalizing the 'm' in I'm.
The full expression is this:
/(?:^\w|[A-Z]|\b\w)/g
The problem here (I think) is that \b\w
will grab the first letter after a word boundary. I'm assuming that single quotes denote a word boundary therefore also capitalizing the m
of I'm
into I'M
.
Can anyone help me change the expression to exclude the 'm' after the single quotes?
Thanks in advance.