Regular Expressions
Discuss and ask questions concerning the usage of Regular Expressions (REGEXes) in the .NET Framework.
お知らせ
- Link
Regex Meets Linq
OmegaManMVP2009年2月4日 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.
フィルタと並べ替えこれらのオプションは、ディスカッションの一覧を絞り込むために使用します。
- 542749

.Net Regex Resources Reference
OmegaManMVP2007年1月19日 19:51 - 22452

.Net Regex Tool - Regex Pixie
Jon von GillernMVP2012年8月23日 1:49 - 1421529

Password Strength Expression
LarryEis 2010年2月9日 19:43 - 1017970

Regex Substraction of Character Set
xalnix 2009年8月13日 20:34 - 016742

How to Ask A Regular Expression Question
OmegaManMVP2010年1月7日 19:18 - 21978

REGEX How to return multiple named groups using multiple expressions
gregc66 2012年12月28日 22:47 - 21474

Need some help figuring out my regex mystery.
JoetheWinDev 2012年12月27日 7:40 - 21542

What does it take to do this really simple match?
eBob.com 2012年12月25日 19:44 - 31464

difference of a{2} and a{2,}
Jakub Jareš 2012年12月25日 8:50 - 31791

Regular Expression Matching and Parsing a string
Chirag Shah 2012年12月21日 18:46 - 93149

regular expression for telecommunications Circuit ID please..
Prakash Athikesavan 2012年7月30日 17:34 - 61756

Whole word match when wildcard exist in search pattern
Mohammed Stephan 2012年12月20日 9:01 - 31742

How can I decorate a field with RegularExpression attribute?
salam.p.v 2012年12月19日 18:15 - 112682

I want a Regex for Decimal(10,4)
salam.p.v 2012年12月19日 13:10 - 72330

VB 2008 Regex Parsing HTML With HTTPWebRequest Implementation...
TeachMe 2012年12月12日 4:10 - 41736

.NET Framework Regular Expressions
Tokimes 2012年12月17日 16:32 - 21567

Replace Question
eBob.com 2012年12月15日 17:35 - 51801

get data from tag
chezhian_in05 2012年12月10日 15:42 - 61869

Find in files: lines containing await but not ConfigureAwait(false)
Sylvain De 2012年12月8日 12:25 - 12016

Prepending a base url to all image tags in HTML source?
RectangleEquals 2012年12月8日 18:52 - 21705

find lines with both words
Serve Laurijssen 2012年12月5日 7:22 - 31729

How to use culture invariant for Regular expression ?
Manjula.C 2012年12月4日 13:06 - 31717

ValidationExpression for alpha-numeric values
yogi3188 2012年11月26日 6:26 - 11379

Get everything after ;#
KonaCoffee 2012年12月4日 17:25 - 61101

I've never been able to figure this REGEX problem out...Newbie!
Mr. Javaman II 2012年11月29日 22:49

