I have a scenario where in a text file there are multiple xml records with some other data as well. I wrote a regex code in a foreach in c# to extract the XML.Below is the code.
foreach (Match match in Regex.Matches(File.ReadAllText(file), @"<Root>(?<sender>.*)</Root>"))
{}
The problem I am facing is that it is not iterating on the whole file but only picking up few records.
Is there something wrong in the regex or some other problem is there.