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

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

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

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

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

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

Regex Searches
GameboyHippo Sunday, November 22, 2009 9:51 PM - 015

Regex that excludes specified entrance
Senglory 3 hours 27 minutes ago - 2107

Regular expression: String start with <div> end with <br /> or </div> which ever comes first
sky789 Friday, November 20, 2009 5:02 PM - 13163

Regular Expression to restrict exe and batch file
meetjaydeep3 Monday, November 23, 2009 9:27 AM - 7409

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

Regular Expression Grouping
Cleyton Jordan Friday, November 20, 2009 2:48 PM - 193

finding strings that start with "(" .. regex match not working
JCNET Thursday, November 19, 2009 12:26 PM - 3173

How to make regex for specific needs?
Saad Khan Tuesday, November 17, 2009 7:20 PM - 2131

SSRS reporting VB script regex help
JnewBee Tuesday, November 17, 2009 4:27 AM - 7368

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

Removing certain spaces in a text
ofireps Monday, November 09, 2009 4:42 PM - 1141

regular expression to accept either 6 or 9 length digits [and ignore leading and trailing spaces]
Kamran Shahid Sunday, November 15, 2009 8:07 PM - 1134

How To Exclude an Email Domain using CreateUserWizard?
Tim Hirtle Saturday, November 14, 2009 9:27 PM - 4188

Why Regex Failed
Rahul P Nath Friday, November 13, 2009 6:56 AM - 1137

ignore comment lines
Nicoolai Friday, November 13, 2009 2:33 PM


