JSFiddle - React, Tailwind, and code Playground JavaScript var reg = new RegExp('\\b(tap(?!\"))', 'ig') alert(('tap click "tap" tap.').match(reg));