private string searchFile(String path, String searchText)
{
string regex=@"(?i)(?<="+searchText+@"\s*=\s*)\d+";
return Regex.Match(File.ReadAllText(path),regex).Value;//version number
}
This is what I tried and it gives the correct output
string s="Wireless = 1 Cradle = 2";
Regex.Match(s,@"(?i)(?<=Wireless\s*=\s*)\d+").Value;//1