I can’t figure out how to extract specific numbers with a specific match from a string.
Example:
string myString = "blah blah **[10]** blah **[20]** and some more blah **[30]**";
Regex myIDsReg = new Regex(@"\*\*\[(\d+)\]\*\*");
Apparently the regex is sound.
Match myMatch = myIDsReg.Match(myString);
Yields “**[10]**” but nothing else.
I can’t figure out how to get an array with the following values: 10, 20, 30
I would do this
You can select which output you want as well
or
I’d prefer one of the two latter