JSFiddle - React, Tailwind, and code Playground

by Serhioromano

JavaScript

var text = "asd <z>text1</z> dgfh <z>text2</z> gfhj";
string pattern = "<z.*?>(.*?)</z>";         
Regex r = new Regex(pattern);
console.log(1);

foreach (Match match in r.Matches(text))
{           
    string textBetweenTags = match.Groups[1].ToString();
    //your logic here
}