Regular Expressions
Discuss and ask questions concerning the usage of Regular Expressions (REGEXes) in the .NET Framework.
Annonces
- Link
Regex Meets Linq
OmegaManMVPmercredi 4 février 2009 17:16If 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
- Link
This Forum Has Been Retired
This forum is locked; it is still available for review in the Archived Forums folder. Any future posts on this topic should be put in the .NET Framework Class Libraries forum.
Filtre et triUtilisez ces options pour affiner la liste des discussions.
- 542754

.Net Regex Resources Reference
OmegaManMVPvendredi 19 janvier 2007 19:51 - 22453

.Net Regex Tool - Regex Pixie
Jon von GillernMVPjeudi 23 août 2012 01:49 - 1421530

Password Strength Expression
LarryEis mardi 9 février 2010 19:43 - 1017975

Regex Substraction of Character Set
xalnix jeudi 13 août 2009 20:34 - 016744

How to Ask A Regular Expression Question
OmegaManMVPjeudi 7 janvier 2010 19:18 - 21982

REGEX How to return multiple named groups using multiple expressions
gregc66 vendredi 28 décembre 2012 22:47 - 21474

Need some help figuring out my regex mystery.
JoetheWinDev jeudi 27 décembre 2012 07:40 - 21545

What does it take to do this really simple match?
eBob.com mardi 25 décembre 2012 19:44 - 31465

difference of a{2} and a{2,}
Jakub Jareš mardi 25 décembre 2012 08:50 - 31791

Regular Expression Matching and Parsing a string
Chirag Shah vendredi 21 décembre 2012 18:46 - 93149

regular expression for telecommunications Circuit ID please..
Prakash Athikesavan lundi 30 juillet 2012 17:34 - 61757

Whole word match when wildcard exist in search pattern
Mohammed Stephan jeudi 20 décembre 2012 09:01 - 31744

How can I decorate a field with RegularExpression attribute?
salam.p.v mercredi 19 décembre 2012 18:15 - 112693

I want a Regex for Decimal(10,4)
salam.p.v mercredi 19 décembre 2012 13:10 - 72332

VB 2008 Regex Parsing HTML With HTTPWebRequest Implementation...
TeachMe mercredi 12 décembre 2012 04:10 - 41739

.NET Framework Regular Expressions
Tokimes lundi 17 décembre 2012 16:32 - 21567

Replace Question
eBob.com samedi 15 décembre 2012 17:35 - 51801

get data from tag
chezhian_in05 lundi 10 décembre 2012 15:42 - 61869

Find in files: lines containing await but not ConfigureAwait(false)
Sylvain De samedi 8 décembre 2012 12:25 - 12018

Prepending a base url to all image tags in HTML source?
RectangleEquals samedi 8 décembre 2012 18:52 - 21707

find lines with both words
Serve Laurijssen mercredi 5 décembre 2012 07:22 - 31729

How to use culture invariant for Regular expression ?
Manjula.C mardi 4 décembre 2012 13:06 - 31718

ValidationExpression for alpha-numeric values
yogi3188 lundi 26 novembre 2012 06:26 - 11381

Get everything after ;#
KonaCoffee mardi 4 décembre 2012 17:25 - 61101

I've never been able to figure this REGEX problem out...Newbie!
Mr. Javaman II jeudi 29 novembre 2012 22:49

