Search Options
close
Search the following clips:
All Clips
Everyone's Clips
My Guides
Sign Up
Install
Learn More
Login
LINQ To Regex
travislaborde
follow
0
5-7-2008 7:48 AM
408 views
tags:
programming
,
.net
,
linq
Add a Comment
Login
to Comment. Not a member yet?
Sign up
Today's Top Clips
Iranian men in scarves - a new protest tactic
The 50 Funniest Headlines Of 2009 [pics]
Agnes Cross: Would Tiger Woods Please Go Away?
Al Gore busted on World Stage
Groups Say 22 Million Missing Bush White House E-Mails Found
Chinese Farmers Sell Blood To Make Ends Meet
New Disturbing Trend: Baby Wigs.
Door Mats
Climategate Revelations are but the Tip of a Giant Iceberg
A Merry Christmas and a Happy New year to all my friends
visit the
Top Clips page
View the Top Clips from
May 7, 2008
Embed This Clip In Your Site...
<div style="margin: 12px 0px; font-family: arial; color: #333333; background: #ffffff; border: solid 4px #e5e5e5; width: 100%; clear: left;"><div class="CM_CTB_Content_Wrap" style="margin: 0px; padding: 0px;background-color: #ffffff;"><div style="border-bottom: solid 1px #dcdcdc; white-space: nowrap; margin-bottom: 8px; background-color: #eeeeee ;background-image: url(http://www.clipmarks.com/images/source-bg.gif); background-repeat: repeat-x; height: 24px; line-height: 24px; vertical-align: middle; padding-bottom: 4px; color: #666666; font-size: 10px;" ><a href="http://clipmarks.com/clip-to-blog/" title="see clips that are hot right now"><img src="http://content.clipmarks.com/blog_embed/12ae4378-265f-4700-8dd2-4519b737ae16/6CD09501-3F47-4F39-BE69-C082E69104BC/" alt="" width="19" height="19" border="0" style="vertical-align: middle; margin: 0px 4px; display: inline; border: none; float:none;" /></a>clipped from <a title="http://weblogs.asp.net/rosherove/archive/2008/05/06/introducing-linq-to-regex.aspx" href="http://weblogs.asp.net/rosherove/archive/2008/05/06/introducing-linq-to-regex.aspx" style="font-size: 11px;">weblogs.asp.net</a></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://weblogs.asp.net/rosherove/archive/2008/05/06/introducing-linq-to-regex.aspx"><H2>Introducing LINQ To Regex</H2></blockquote><div style="height: 2px; font-size: 2px; background: #dcdcdc; border-bottom: solid 1px #f5f5f5; margin: 2px 4px;"></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://weblogs.asp.net/rosherove/archive/2008/05/06/introducing-linq-to-regex.aspx"><DIV> <P> [<SPAN>Test</SPAN>]</P> <P> <SPAN>public</SPAN> <SPAN>void</SPAN> <SPAN>FindEmailUsingPattern</SPAN>()</P> <P> {</P> <P> <SPAN>var</SPAN> <SPAN>query</SPAN> <SPAN>=</SPAN> <SPAN>from</SPAN> <SPAN>match</SPAN> <SPAN>in</SPAN> </P> <P> <SPAN>RegexQuery</SPAN><SPAN>.</SPAN><SPAN>Against</SPAN>(<SPAN>"sdlfjsfl43r3490r98*(<A href="http://weblogs.asp.net/rosherove/archive/2008/05/06/mailto:*Email@somewhere.com_dakj3j">*Email@somewhere.com_dakj3j</A>"</SPAN>)</P> <P> <SPAN>where</SPAN> <SPAN>match</SPAN><SPAN>.</SPAN><SPAN>Word</SPAN><SPAN>.</SPAN><SPAN>Repeat</SPAN><SPAN>.</SPAN><SPAN>AtLeast</SPAN>(<SPAN>1</SPAN>)</P> <P> <SPAN>.</SPAN><SPAN>Literal</SPAN>(<SPAN>"@"</SPAN>)</P> <P> <SPAN>.</SPAN><SPAN>Word</SPAN><SPAN>.</SPAN><SPAN>Repeat</SPAN><SPAN>.</SPAN><SPAN>AtLeast</SPAN>(<SPAN>1</SPAN>)</P> <P> <SPAN>.</SPAN><SPAN>Literal</SPAN>(<SPAN>"."</SPAN>)</P> <P> <SPAN>.</SPAN><SPAN>Choice</SPAN><SPAN>.</SPAN><SPAN>Either</SPAN>(</P> <P> <SPAN>Pattern</SPAN><SPAN>.</SPAN><SPAN>With</SPAN><SPAN>.</SPAN><SPAN>Literal</SPAN>(<SPAN>"com"</SPAN>),</P> <P> <SPAN>Pattern</SPAN><SPAN>.</SPAN><SPAN>With</SPAN><SPAN>.</SPAN><SPAN>Literal</SPAN>(<SPAN>"net"</SPAN>))</P> <P> <SPAN>.</SPAN><SPAN>IsTrue</SPAN>()</P> <P> <SPAN>select</SPAN> <SPAN>match</SPAN>;</P> <P> <SPAN>foreach</SPAN> (<SPAN>var</SPAN> <SPAN>match</SPAN> <SPAN>in</SPAN> <SPAN>query</SPAN>)</P> <P> {</P> <P> <SPAN>Assert</SPAN><SPAN>.</SPAN><SPAN>AreEqual</SPAN>(<SPAN>"Email@somewhere.com"</SPAN>,<SPAN>match</SPAN><SPAN>.</SPAN><SPAN>Value</SPAN>);</P> <P> }</P> <P> }</P> </DIV></blockquote></div><div style="margin: 0px 6px 6px 4px;"><table style="font-size: 11px;border-spacing: 0px;padding: 0px;" cellpadding="0" cellspacing="0" width="100%"><tr><td style="background:transparent;border-width:0px;padding:0px;"> </td><td align="right" style="background:transparent;border-width:0px;padding:0px;width:107px" width="107"><a href="http://clipmarks.com/share/6CD09501-3F47-4F39-BE69-C082E69104BC/blog/" title="blog or email this clip"><img src="http://content7.clipmarks.com/images/c2b-foot.png" border="0" alt="blog it" width="107" height="17" style="border-width:0px;padding:0px;margin:0px;" /></a></td></tr></table></div></div>
New from the makers of Clipmarks:
Amplify.com - Don't just share the news...Amplify it!
Clipmarks
Home
New Clips
Top Clips
Dashboard
Popular Topics
News
Life
Science
Technology
Entertainment
Get Started
Sign Up
Install Clipping Tool
How Clipping Works
Clip-to-Blog™
ClipSearch
Tools and Resources
FAQ
ClipWeek
Top Clippers
Top Tags
Site Map
About Clipmarks
About Us
Contact
Copyright
Privacy
EULA
OK