This is function matching apostrophe via regex and JavaScript. Also find broken apostrophe and match whole word.