im trying to extract a substring with regex but im having some troubles...
The string is build from a columns of strings and i need the the 4th column only
string stringToExtractFrom = "289 120 00001110 ??
4Control@SimApi@@QAEAAV01@ABV01@@Z = ??4Control@SimApi@@QAEAAV01@ABV01@@Z
(public: class SimApi::Control & __thiscall SimApi::Control::operator=(class
SimApi::Control const &))"
string pattern = @"\s+\d+\s+\d+\s+\S+\s(.*)\=";
RegexOptions options = RegexOptions.Multiline;
Regex regX = new Regex(pattern, options);
Match m = regX.Match(stringToExtractFrom);
while (m.Success)
{
Group g = m.Groups[1];
defData += g+"\n";
m = m.NextMatch();
}
this is the wanted string: ?? 4Control@SimApi@@QAEAAV01@ABV01@@Z
with the string below it worked when i got the substring i want as a group
1 0 00002E00 ??0ADOFactory@SimApiEx@@QAE@ABV01@@Z = ??0ADOFactory@SimApiEx@@QAE@ABV01@@Z (public: __thiscall SimApiEx::ADOFactory::ADOFactory(class SimApiEx::ADOFactory const &))
Regex.Match(stringToExtractFrom, @"\B\?\?\S*").Valuewill do?