how to find a particular pattern in the content of the text file in c# .net? [closed]
Can anyone please help for above question.
I'm guessing you want to use a combination of TextReader to read the text from the file and RegEx to match the pattern.
It would be difficult to give you any examples since you don't provide any exact details.
You can always use a regular expression in order to do it, but perhaps i didn't understand the question..
Use regular expressions.
http://www.codeproject.com/KB/dotnet/regextutorial.aspx
You can use Regular Expressions to find any pattern. A tutorial can be found here: http://dotnetperls.com/regex-file
- Use
File.ReadAllText()
to read the content. - Use
Regex.Matches(
) to look for the pattern.
精彩评论