JSFiddle - React, Tailwind, and code Playground

JavaScript

var s = "abcde\n		fghij<FooBar>";
var rx = /([\s\S]*)<FooBar>/;
var res = s.match(rx);
if (res) {
	console.log(res[1]);
}