Sandor Korozsi’s linkblog

  .NET Framework, C#, Smartphone, Pocket PC, Managed DirectX, Game development
ASP.NET, Regular expressionApril 25, 2007 10:58

 You can filter for a valid URL format using a regular expression, as the following:

^(?:http(?:s)*|ftp)://[a-zA-Z0-9\.\-]+(?:\:\d{1,5})?(?:[A-Za-z0-9\.\;\:\@\&\=\+\$\,\?\-/]|%u[0-9A-Fa-f]{4}|%[0-9A-Fa-f]{2})*$

 I found the original regexp at msdn but I’ve extended it with one more character: "-" in the "virtual dir" section and have made the first group shorter.

Development, Link, Tool, Regular expressionApril 18, 2007 12:53

The Regulator is an advanced, free regular expressions testing and learning tool written by Roy Osherove. It allows you to build and verify a regular expression against any text input, file or web, and displays matching, splitting or replacement results within an easy to understand, hierarchical tree.

The Regulator - Get Serious About Regular Expressions

Development, Link, Regular expressionApril 2, 2007 16:16

This article demonstrates how to use regular expressions and RegEx class (System.Text.RegularExpressions namespace) to build the find and replace functionality found in most of the text editors and word processors.

Find and Replace with Regular Expressions - The Code Project - C# Programming