News in the Category: Regex Subscribe to the rss of this category.

Total posts: 906 | Sort by Views | Sort by Hits

MSDN Regular Expression Forum

Eric Gunnersons C# Compendium, March 1, 2007
Views: 129,625 | Hits 1,998

There's now an MSDN Regular Expression Forum...

Custom bi-directional sorting in GridView

mikes web log, February 1, 2006
Views: 6,487 | Hits 1,420

One of the things I like is how as you work with ASP.NET (or anything), your instincts develop a bit and you can figure out how to do stuff with only a few dents in your forehead where you've been ban...

Extract Literal Text from HTML - Recent Patterns, September 3, 2007
Views: 6,071 | Hits 840

This regular expression allows you to extract literal text from an HTML (SGML compliant?) document. i believe it will also work for XML. using code to replace the HTML element you can extract the lite...

Simple function to split camelCase words

Technology and Programming - Speednets Lottery Post Blog, August 30, 2007
Views: 6,065 | Hits 835

The phrase "camel case" is used to describe a common method of naming variables, properties, and methods in a programming language.It is useful for stringing several words together, while ma...

Mobile No Validation - Recent Patterns, September 14, 2006
Views: 7,603 | Hits 731

This Pattern is to Validate Mobile Number with 10 digit Number and Countrycode as Optional....

How to Harvest Emails With Google And Protect Yours From Spammers

youve been HAACKED, April 3, 2007
Views: 1,808 | Hits 708

Just something I noticed today. A lot of people (I may even be guilty of this) publish their emails on the web using the following format: name at gmail dot com Substitute gmail dot com with your fav...

Multi-format date regex - Recent Patterns, May 16, 2007
Views: 6,518 | Hits 605

Another date regex. From year 1600-9999, days in month and leap year checks. Formats include MM-dd-YYYY, dd-MM-yyyy, yyyy-MM-dd, MMM dd,yyyy or dd MMM yyyy. Years are always four digits, months can ...

VS.NET 2005 Debugger chokes on COM/.NET Interop Debugging

Rick Strahls WebLog, October 26, 2005
Views: 2,771 | Hits 587

Aargh…   I’m spending some time today adding .NET 2.0 features to Help Builder’s type import routines. For the most part I expected this to go real smoothly but as it turns out&...

Type.GetType on generic with one or two arguments

MrDaves (David Yack) Blog!, October 19, 2005
Views: 5,893 | Hits 585

You can add this to the beyond the basics on Generics.  If you wanted to use GetType on a regular class you could just do Type.GetType(“MyNameSpace.MyClass”) and your good to go. ...

URL Validator - Recent Patterns, July 27, 2007
Views: 4,288 | Hits 564

A simple but powerful URL validating regex. Will only accept hyper text transfer protocol (http) but can be easily changed to accept others. Accepts multiple subdomains and subdirectories. Even accept...

Don't Be a Validation Nazi

youve been HAACKED, August 27, 2007
Views: 1,609 | Hits 560

In my last post, I wrote about how most email validation routines are too strict when compared against what is allowed by the RFC. Initially I dismissed this phenomena as the result of ignorance of th...

Regular expression for validating currency input with sign - Recent Patterns, May 21, 2007
Views: 5,212 | Hits 551

This expression is for matching the currency input. The is optional. e.g. 12.12, 12.12, 12.12, 12....

ASP.NET ItemTemplates, EVAL() and embedding dynamic values into controls

Rick Strahls WebLog, April 27, 2006
Views: 4,847 | Hits 490

Dealing with complex Eval() expressions inside of ItemTemplate or other data containers always makes me do a double take. Here are a few observations and thoughts on how to handle and possibly improv...

Splitting Camel Case with RegEx

JonGalloway.ToString(), September 27, 2005
Views: 4,561 | Hits 417

Phil posted some code to Split Pascal/Camel Cased Strings a few days ago. We had an offline discussion on doing this via RegEx. I like the RegEx approach since it's only one line of code: output&nbs...

Regular Expression Visualizer - A Must Have Tool

Chris Love's Official Blog - Professional ASP.NET, June 19, 2008
Views: 2,812 | Hits 397

This week I saw a twitter from Roy Osherove about a new Regular Expression Visualizer he built. If you do not know Roy yet, he is a very smart .NET developer for TypeMock and has done some great work ...

Latitude Validation - Recent Patterns, October 30, 2006
Views: 4,449 | Hits 397

I was inspired by this regexp - Matches a whole number between 1 and 20 inclusively - because it was doing something I could not find elsewhere so this is how I expanded it to validate lat values...

Regex: Parse html tags to extract tag names and parameters with parameter name/value pairs. - Recent Patterns, December 11, 2005
Views: 9,258 | Hits 391

Regex: Parse html tags to extract tag names and parameters with parameter name/value pairs. ********************************************* ...

Match Valid UK Postcode - Recent Patterns, March 6, 2007
Views: 4,257 | Hits 367

Validates a complete UK postcode. Returns the two halves in sub-expressions. Supports the following 7 formats: A1 1AA, A11 1AA, A1A 1AA, AA1 1AA, AA11 1AA, AA1A 1AA GIR 0AA (** And the same 7 formats ...

Indian Telephone Number Format - Recent Patterns, October 16, 2006
Views: 5,816 | Hits 364

This is a bit strict validation format for a telephone number. It has been tested and used on live server and it works fine without any error. +91 indicates ISD code for India. Numbers inside brackets...

Longitude Validation - Recent Patterns, October 30, 2006
Views: 3,935 | Hits 350

Longitude validation (similiar to Latitude Validation) and inspired by the same code...

Password Validation - Recent Patterns, September 4, 2007
Views: 4,206 | Hits 347

Well, I don't remember where from I got this expression, but I modified it a bit to work with 2.0's Regular expression validator. This validates if the password has atleast 6 characters, of wh...

Dynamic URL Rewriter for ASP.NET 2.0

MarkItUp - Thinking Products, January 19, 2006
Views: 1,953 | Hits 317

Seen via Scott Guthrie's blog is a cool HttpModule that you can use to perform dynamic URL rewrites using regular expressions. There's a UrlMapper that comes out-of-the-box with ASP.NET 2.0 but it doe...

YYYY-MM-DD HH:MM:SS - Recent Patterns, June 30, 2007
Views: 5,799 | Hits 314

SQL datetime format tester YYYY-MM-DD HH:MM:SS...

Next milestone for Expression tools

Somasegars WebLog, January 24, 2006
Views: 1,423 | Hits 313

Today, we are shipping the first CTP of Sparkle (Expression Interactive Designer) and the next CTP of Acrylic (Expression Graphic Designer).  You can download the CTP drops for both the products ...

HTML Anchor (link) tag - Recent Patterns, October 17, 2006
Views: 3,876 | Hits 309

This regex will match all html link tags and captures the url into a named capture "url". There can be any html code between the opening and closing link tags. You must use this with the multiline a...

Find IP Address Block Range - Recent Patterns, September 3, 2007
Views: 5,032 | Hits 307

This expression matches IP Addresses between - which is a block range of 16 addresses. I created this expression for Google Analytics to filter out hits from our companies of...

UK Postcode - Recent Patterns, March 2, 2007
Views: 4,147 | Hits 302

This regex have been created as per the information provided on This expression will allow the postcodes with space or without sp...

UK Telephone - Recent Patterns, July 7, 2006
Views: 3,000 | Hits 298

This regex matches UK phone numbers in multiple formats, including those that begin with the international dial code and optionally bracket the leading zero of the area code. To match a number must be...

Address Parser - Recent Patterns, November 19, 2008
Views: 3,568 | Hits 285

A quick and dirty expression for splitting up a generic street address...

Iterators, Expressions, and LINQ for Euler

Steven Smith, August 27, 2009
Views: 1,565 | Hits 285

Recently Ive been doing some Project Euler problems as exercises to help improve my coding skills.  We do this internally at NimblePros periodically and also at last weeks Hudson Software Craftsm...

Clear Type this is supposed to be better

Rick Strahls WebLog, July 25, 2005
Views: 1,316 | Hits 283

This weekend, because I was at Code Camp, I went to Hanselman’s speaker orientation session and there were a few cool tips for managing fonts etc. I’m becoming a Hanselman groupie I guess ...

ASP.NET: REGEX Parse the RSS / ATOM Feed Url from a Page

Peter Brombergs UnBlog, August 18, 2007
Views: 3,300 | Hits 280

I've been scraping again, I confess. Just can't resist it. One of the things I've run into when grabbing a bunch of web pages in a threadpool callback is how to determine if the page sports the autodi...

Expression Tree Visualizer

Granville Barnett, September 15, 2007
Views: 3,591 | Hits 279

I played with this a while back but never blogged about it and thought that maybe I should do now as its a pretty nifty tool. First and foremost, if you have not looked at C# 3.0 or LINQ then here are...

The Next Regex Regulator

ISerializable, March 1, 2006
Views: 1,350 | Hits 275

It hasn't left my mind! ...

Credit Card pattern Matching - Recent Patterns, June 12, 2007
Views: 4,012 | Hits 273

This regular expression will match the all type of credit card patterns, like AMEX,VISA,MASTER, Dinnerclub, JCB, enRoute ,Discover...

Introducing Regulazy: Point & Click Regular Expressions

ISerializable, July 10, 2006
Views: 2,460 | Hits 264

Regulazy is an attempt to build a small "Expert System" for creating .NET Regular Expressions. It lets the user create an expression based on a real life example of text they would like to parse. ...

Expression Tools Team Blog

Somasegars WebLog, March 2, 2006
Views: 1,357 | Hits 261

The Expression Tools team recently started a team blog site.  If you are interested in hearing from the team members who are building the Expression family of tools (Graphic Designer, Interactive...

Regular Expression Based Token Replacement in ASP.NET

Simple Talk, January 10, 2007
Views: 1,192 | Hits 257

Damon Armstrong presents an extremely powerful and flexible token replacement mechanism for your ASP.NET applications. It is based on regular expressions so allows you to search for dynamic text, inst...

Birthday regular expression Dutch - Recent Patterns, May 4, 2007
Views: 4,633 | Hits 257

I needed to have a birthday regular expression in dutch format with full year (1900) so i wrote this one....

Validate a 3 field CSV file - Recent Patterns, December 29, 2006
Views: 3,130 | Hits 256

This pattern validates a 3 field CSV file. I designed it to capture first name, last name and email address in that order....

URL Parsing Regex - Recent Patterns, December 11, 2006
Views: 3,341 | Hits 252

This regex matches fully qualified external urls (http, https, or ftp). It uses the ms specific group-naming structure to present friendly named groups back to the user....

UK Mobile Phone Number Check - Recent Patterns, February 18, 2007
Views: 3,908 | Hits 245

UK Mobile phone number check...

Validate URL - Recent Patterns, June 20, 2007
Views: 3,911 | Hits 234

A regex I came up with for validating urls, didn't test thoroughly but seems to do the trick....

FQDN Validation - Recent Patterns, April 18, 2007
Views: 5,831 | Hits 233

Validates MS FQDNs. 1) Entire fqdn less than 255 chars. 2) Host and domain names may contain an underscore. 3) 1st char can be a number. 4) No part can be all numbers. 5) Allows any TLD Works in C#. B...

Expanding Urls with RegEx in .NET

Rick Strahls WebLog, December 22, 2006
Views: 3,049 | Hits 233

One of the things I need frequently is to take text entered and expand URLs in it. Theres code in my library that handles this via an ExpandUrls class that does this:   public class ExpandUrlsPa...

Regex: Query string parser matches and tokenizes each name/value pair for a valid query string. - Recent Patterns, August 19, 2005
Views: 9,441 | Hits 233

Regex: Query string parser matches and tokenizes each name/value pair for a valid query string. ********************************************* ...

Filling the pipeline...

Panopticon Central, April 12, 2006
Views: 1,654 | Hits 226

I was on a thread today where a VB MVP asked if VB was ever going to integrate regular expression-type functionality directly into the language to make it easier (and more comprehensible) to work...

Date-MM/DD/YYYY MONTH/DATE/YEAR - Recent Patterns, April 19, 2007
Views: 4,481 | Hits 225

This regular expressions matches dates in the format MM/DD/YYYY where MM can be 01 to 12, DD can be 01 to 31 and YYYY is always 4 digits long....

First Look at Expression Web Designer

Rick Strahls WebLog, May 22, 2006
Views: 2,705 | Hits 223

A few days ago I downloaded Microsoft's Web Expression Designer. I'd seen a few previews of this tool at PDC and then during some recent Microsoft events and I was fairly excited by what I saw at the ...

MVC3 requires unobtrusive validation if you want jquery validation

Wayne Brantley, January 15, 2011
Views: 2,943 | Hits 223

Reading all the new things about MVC3, it appeared to me they had all these options to 'not' enable Unobtrusive javascript. Turns out you really have two choices. You can use msajax style validation (...