JSFiddle - React, Tailwind, and code Playground JavaScript var str = 'abcde abcde'; var re = /ab(cde)/g; alert(str.match(re));