x Did you like it? Well, then please consider making a donation :)

Regex Library

Replace and named capturing group example

Nearly all modern regular expression engines support numbered capturing groups and numbered backreferences. Long regular expressions with lots of groups and backreferences may be hard to read. They can be particularly difficult to maintain as adding or removing a capturing group in the middle of the regex upsets the numbers of all the groups that follow the added or removed group.

Type: replace, Date: 3/30/2015 2:35:04 AMAuthor: admin

Simple Regex.Split sample - remove digits

User \d+ for remove digits and \D+ for remove text.

Type: split, Date: 3/30/2015 12:45:18 AMAuthor: admin

Simple Regex.Replace sample - add for word gmail.com

From MSDN: Regex.Replace processes text replacements. It handles simple replacements and more complex ones.

Type: replace, Date: 3/30/2015 12:39:02 AMAuthor: admin

Regular expression to extract the year (1900 - 2099) from a string

Getting year from text. If you want validate textbox value - use this pattern with "^" and "$": ^((19|20)\d{2})$

Type: match, Date: 3/28/2015 4:38:20 PMAuthor: admin

Get all HTML tags from page

Using a RegularExpression to match web (HTML code).

Type: match, Date: 3/27/2015 4:21:44 PMAuthor: admin