C# Regular Expressions Recipes(en.csharp-online.net)

submitted by HyleHyle(2755) 5 years, 5 months ago

Learn some common solutions to regular expression problems (System.Text.RegularExpressions) in the C# language. Excerpt: Included in the .NET Framework Class Library is the System.Text.RegularExpressions namespace that is devoted to creating, executing, and obtaining results from regular expressions executed against a string. Regular expressions take the form of a pattern that can be matched to zero or more characters within a string. The simplest of these patterns, such as .* (match anything and everything) and [A-Za-z] (match any letter) are easy to learn, but more advanced patterns can be difficult to learn and even more difficult to implement correctly. Learning and understanding regular expressions can take considerable time and effort, but the work will pay off. Regular expression patterns can take a simple form—such as a single word or character— or a much more complex pattern. The more complex patterns can recognize and match such things as the year portion of a date, all of the <SCRIPT> tags in an ASP page, or a phrase in a sentence that varies with each use. The .NET regular expression classes provide a very flexible and powerful way to do such things as recognize text, replace text within a string, and split up text into individual sections based on one or more complex delimiters. Despite the complexity of regular expression patterns, the regular expression classes in the FCL are easy to use in your applications.

add a comment |category: |Views: 66

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

No comments so far

information Login or create an account to comment on this story