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

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

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

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

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

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

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

(?!) Is causing unitended consequence with a previous match
OmegaManMVP11 hours 6 minutes ago - 139

WebTools.exec_non_qry("UPDATE MAT_INSP SET MRV_ID='" + ddMRV.SelectedValue.ToString() + " WHERE MIR_ID= '" + mrr_id + '" AND MVR_ID = '" + MRVP_ID + "'");
sarat.net 12 hours 24 minutes ago - 185

Client Script with RegEx
RoninB Wednesday, May 23, 2012 1:09 PM - 16625

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

app.config
SonuManwal Tuesday, May 22, 2012 6:40 AM - 2123

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

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

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

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

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

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

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

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

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

