Windows Forms: How to Use Regular Expressions
This sample application shows how to use regular expressions. If you are not
familiar with regular expressions, they are a well-established and standard way
to parse text files as well as to search and optionally replace occurrences of
substrings and text patterns. They can be a very powerful tool in your
development arsenal. For more information, go to
http://msdn.microsoft.com and type "regular expressions" in
the search engine.
Featured Highlights
-
The "Simple Samples" tab is a good introduction to the use of regular
expressions. You can see how to find the first occurrence of a number in a
string, as well as try out increasingly difficult examples of field validation.
-
The "Screen Scrape" tab shows off more advanced uses of regular expressions.
You can enter a Web address and view the links or images contained therein.
HTML tag attributes are displayed in a ListView control. You can double-click
an image to view it, or double-click a link to open Internet Explorer and view
the page.
-
The "RegEx Tester" tab provides a convenient way for you to experiement with
regular expressions. It also demonstrates how to do search and replace and
string splitting.
Requirements
To run the Screen Scrape examples you will need an active connection to the
Internet.
Microsoft Visual Studio.NET Professional
Windows 2000 or Windows XP.
Running the Sample
Simply press F5.
See Also
Regular Expression Classes
Regular Expression List