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.
- 151756

How to: Verify That Strings Are in Valid E-Mail Format
NastyBastard Thursday, May 28, 2009 10:39 PM - 132933

Does VS have a customized RegEx?
JohnGrove Tuesday, May 12, 2009 9:58 PM - 29796

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

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

Visual Studio Auto Shudwon Error...Help.
Nano HE Monday, November 02, 2009 2:17 AM - 1103

How to check for space in a password regex having multiple condition
Rajendra Dewani Friday, November 06, 2009 3:25 PM - 278

How do I look for all the alert and confirm prompts in a given web page using Regular Expressions?
xs8899 Friday, November 06, 2009 9:02 AM - 159

Get string starting with XYZ ending ABC
sky789 Friday, November 06, 2009 4:19 PM - 62278

validating an Email ID?
srinathns Tuesday, August 21, 2007 6:56 AM - 4868

Validatiom email
Leandro Rodrigues Thursday, August 24, 2006 12:04 PM - 6644

Email address regular expression
waterding Tuesday, September 15, 2009 2:13 PM - 104725

Email-Validation using C#.net
Divakar_ibpm Wednesday, April 30, 2008 1:39 PM - 152

Find all matches with different capitalization
Ralf_from_Europe Friday, November 06, 2009 10:56 AM - 6254

Match Values inside Tags as
MAbshir Tuesday, October 27, 2009 2:23 PM - 287

Problems escaping some characters
BitFlipper Thursday, November 05, 2009 10:21 PM - 195

How to find misspelled words with regex
tommyolesen Thursday, November 05, 2009 11:14 AM - 3115

Match whole numbers
Pilot_ Wednesday, November 04, 2009 5:15 PM - 6198

RegEx maximum length doesnt work for me.
Werner Clausen Wednesday, October 28, 2009 10:46 AM - 6172

How to read string end with question mark in regular expression?
co coe Monday, November 02, 2009 6:00 AM - 1125

What the RegEx to identify STYLE tags?
Wiznet972 Tuesday, November 03, 2009 9:42 PM


