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

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

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

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

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

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

Signtool reported an error 'keyset does not exist' - When building
MurrayS 15 hours 48 minutes ago - 7402

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

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

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

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

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

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

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

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

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 - 1131

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

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

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

Weird result
Motaro Thursday, November 12, 2009 9:10 AM - 56030

RegEx Request : Get all the <img src=""> tag in a webpage.
Ciel Bleu Tuesday, March 13, 2007 2:01 AM


