JSFiddle - React, Tailwind, and code Playground

by alexdickson

JavaScript

var str = "SOme TEXT #extract1$ Some more text #extract2$ much more text #extract3$ some junk";

var matches = str.match(/#(.+?)\$/gi);

console.log(matches);