Regular Expressions
Discuss and ask questions concerning the usage of Regular Expressions (REGEXes) in the .NET Framework.
Announcements
Regex Meets Linq
OmegaManMVPWednesday, February 04, 2009 5:16 PMIf you love Regex...then Regex and Linq is a match made in Heaven. Here are two scenarios where Regex and linq can be used together.- Place Key Value Pairs into a dictionary<string,string> object from regex: Regex To Linq to Dictionary in C#
Here is a quick example where this input "123abcd3" will tokenized into digits or characters and placed into an IEnumerable array with values of "123", "abcd" and "3".
The tokenization will occur and the named match Tokens will contain sub captures. Those captures will be enumerated and placed into an IEnumerable <string> array.string input = "123abcd3"; string pattern = @"(?<Tokens>\d+|[a-zA-Z]+)+"; var items = from Match m in Regex.Matches( input, pattern ) from Capture cpt in m.Groups["Tokens"].Captures select cpt.Value; Console.WriteLine( string.Join( ",", items.ToArray() ) ); // Outputs // 123,abcd,3
This should get you started in using Linq with Regex. GL HTH
Filtering and SortingUse these options to narrow down the question and discussion list.
- 1416244

Password Strength Expression
LarryEis Tuesday, February 09, 2010 7:43 PM - 33288

New Article on Regex speed versus XML processing
OmegaManMVPFriday, November 25, 2011 6:48 PM - 1014864

Regex Substraction of Character Set
xalnix Thursday, August 13, 2009 8:34 PM - 436978

.Net Regex Resources Reference
OmegaManMVPFriday, January 19, 2007 7:51 PM - 528317

Visual Studio 200X (IDE) - Regular Expressions
OmegaManMVPWednesday, January 31, 2007 10:59 PM - 013478

How to Ask A Regular Expression Question
OmegaManMVPThursday, January 07, 2010 7:18 PM - 239

app.config
SonuManwal 23 hours 50 minutes ago - 265

Need help with regular expression
mgarins_wi Monday, May 21, 2012 9:20 PM - 9708

Parsing a templated web page
Shmuel Englard Thursday, May 03, 2012 3:27 PM - 712171

Regular Expression For US Phone Number in C#?
Ganapatisb Thursday, October 01, 2009 7:13 AM - 1156

Length and word ending validation
PegaOleg Thursday, May 17, 2012 10:55 PM - 5301

Regex to get data before any tag
SagarJoshi Tuesday, May 15, 2012 1:47 PM - 4431

Regular Expression
P_M_K Wednesday, May 09, 2012 6:44 AM - 2311

Find index of word with condition using regular expression?
balaji_rcs Monday, May 14, 2012 8:48 AM - 1184

Back References on Regular Expression. Needs Help
karen lin Wednesday, May 16, 2012 5:04 PM - 15553

split using regular expressions
vijay.chvk Tuesday, May 08, 2012 6:05 AM - 126660

How Do I Extract Particular Text From Web Page?
Inforequester123 Tuesday, March 16, 2010 6:10 AM - 1281

The first character of a string is a number.
jpham79 Saturday, May 12, 2012 2:02 AM - 829050

Regular Expression syntax for C#
jdang Wednesday, May 31, 2006 4:10 PM - 2576

VB.NET Extract HTTP link from string
Auhn Monday, May 07, 2012 6:13 PM

