Regular Expressions
Discuss and ask questions concerning the usage of Regular Expressions (REGEXes) in the .NET Framework.
公告
Regex Meets Linq
OmegaManMVP2009年2月4日 下午 05: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
篩選及排序使用這些選項可縮小討論清單。
- 172079

How to: Verify That Strings Are in Valid E-Mail Format
NastyBastard 2009年5月28日 下午 10:39 - 697

Regex Substraction of Character Set
xalnix 2009年8月13日 下午 08:34 - 133174

Does VS have a customized RegEx?
JohnGrove 2009年5月12日 下午 09:58 - 210094

Visual Studio 200X (IDE) - Regular Expressions
OmegaManMVP2007年1月31日 下午 10:59 - 013670

.Net Regex Resources Reference
OmegaManMVP2007年1月19日 下午 07:51 - 3147

split string logic
a.Net_Phoenix 2009年11月24日 上午 09:57 - 10188

Regular Expression to restrict exe and batch file
meetjaydeep3 2009年11月23日 上午 09:27 - 169

regex to exclude integer in URL greater than
julsbarnes 2009年11月26日 下午 12:24 - 296

Regex that excludes specified entrance
Senglory 2009年11月25日 下午 09:16 - 190

Regex Searches
GameboyHippo 2009年11月22日 下午 09:51 - 2130

Regular expression: String start with <div> end with <br /> or </div> which ever comes first
sky789 2009年11月20日 下午 05:02 - 7414

Match Values inside Tags as
MAbshir 2009年10月27日 下午 02:23 - 4185

Regular Expression Grouping
Cleyton Jordan 2009年11月20日 下午 02:48 - 197

finding strings that start with "(" .. regex match not working
JCNET 2009年11月19日 下午 12:26 - 3189

How to make regex for specific needs?
Saad Khan 2009年11月17日 下午 07:20 - 2135

SSRS reporting VB script regex help
JnewBee 2009年11月17日 上午 04:27 - 7387

RegEx maximum length doesnt work for me.
Werner Clausen 2009年10月28日 上午 10:46 - 6238

Removing certain spaces in a text
ofireps 2009年11月9日 下午 04:42 - 1147

regular expression to accept either 6 or 9 length digits [and ignore leading and trailing spaces]
Kamran Shahid 2009年11月15日 下午 08:07 - 1142

How To Exclude an Email Domain using CreateUserWizard?
Tim Hirtle 2009年11月14日 下午 09:27

