JSFiddle - React, Tailwind, and code Playground JavaScript var str = 'my string here'; var index = str.match(/here/).index; alert(index); // <- 10