I have the following regex:
{thing:([^}]*)}
This matches '{thing:' and '}' exactly, and allows anything !} in the middle.
In C#, I was able to grab only the stuff in the middle with the following:
regex.Matches(stringToCheckForMatches).Cast<Match>().Select(x => x.Groups[1].Value);
Is there an equivalent way to grab that middle stuff in TypeScript? Note also that stringToCheckForMatches can contain multiple instances of the {thing:} keyword (with any middle-stuff content).
For instance, I would want this:
'fooBar/{thing:hi}{thing:hello}'
To return (in an array/list preferably) just this:
hi
hello
Alternatively, if you cannot access .match captures in TypeScript (I am honestly not sure), is there a way to change the regex to something that captures only content after '{thing:' and before '}'? That would also work.