4/17/2008

The Regex Coach

Filed under: Developing .NET — Guus @ 10:38 am

Sometimes you need to build some user input validation on your website. Often I see people using String.Length() and StartsWith/EndWith constructions to check the entered values. Ofcourse this will work, but often this could also be done with Regular Expression. When I ask them, why they do it without this powerful tool they tell me: ‘It works this way and RegEx is way too difficult’.

They have a point when reading a RegExpression for the first time. Often it’s the best way to learn something, by just doing it and playing with it. Last week a saw a tool that is called the regex coach. This enables you to check your RegEx dynamically, without compiling code. So excellent to learn how to write your expression.

image

You can download this tool from the Regex Coach website.

Tip 1: there is a website called RegExLib with frequently used regular expressions. You don’t want to invent the wheel over and over again. (Like a RegEx for e-mail address validation)

Tip 2: It also contains a cheatsheet.

Good luck with building your creative regular expressions!

No Comments »

No comments yet.

RSS feed for comments on this post. | TrackBack URI

Leave a comment

XHTML ( You can use these tags): <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> .