I need to extract a substring from a formatted value as follows:
“(The original reference for ‘item1’ is: 12345)”
The text that I need is 12345. ‘item1’ can change, although the rest of the string should remain static.
I currently have something like this:
string myString = “(The original reference for ‘item1’ is: 12345)”;
string regexMatch = "(The original reference for .* is: ";
Regex regex = new Regex(regexMatch);
Console.WriteLine(regex.Match(myString).ToString());
This just errors saying I need a closing bracket. Can someone point me in the right direction on this one, please?