开发者

how to find a particular pattern in the content of the text file in c# .net? [closed]

It's difficult开发者_开发技巧 to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

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.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜