|
xxx
Regular Expressions additional examples
by Jeff Schoolcraft
Regular Expressions allow complex
string examination and manipulation.
Below are some samples that hint at
their power.
Here is a very simple regexp validator - zipcode:
sourcecode_regexpzip.aspx
Making it a little more complicated, allowing for an optional Zip+4
sourcecode_regexpzip4.aspx
Another simple validator SSN:
sourcecode-regexpssn.aspx
Here is a phone number
sourcecode_regexpphone.aspx
Slightly more interesting and useful, replace double words (the the):
sourcecode_regexpdouble.aspx
Maybe more interesting and less useful, implementing a BBCode style CMS:
sourcecode_regexpreplace.aspx
The rubber meets the road, MB example and this, syntax highlighting:
sourcecode_colorize.aspx
|
The Dan Appleman book is
inexpensive and concise. |
|
this book has decent .net
chapter and goe-s much deeper into the philosopy of regular expressions and
details all the languages they can be called from. |
Online Resources include:
|