In following code, why is the pattern not matched by the regular expression, but it is properly working if I am reading the 12sep.txt file line by line using regular expression?
string file = @"C:\Documents and Settings\Sandeep.kumar\Desktop\12sep.txt";
string filedta = File.ReadAllText(file);
string pattern = @"^[^\s]+.[^\s]txt$";
Regex rx = new Regex(pattern, RegexOptions.None);
MatchCollection mc = rx.Matches(filedta);