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
194 views
tags:
programming
,
.net
,
linq
Add a Comment
Login
to Comment. Not a member yet?
Sign up
Related Clips
Goodbye To Faulty Software?
FOSSwiki
Which Linux distribution should I use
Sam Gentile Defines SOA
The Golden Rule of Data Manipulation
Does object orientation really work?
Children are naturally prone to be empathi...
More clips from
travislaborde
Does object orientation really work?
Speeding Up FireFox When Using the ASP.NET...
Report: 98 Percent Of U.S. Commuters Favor...
Today's Top Clips
Nothing to lose but their chains
Dust Storms In Sahara Desert Sustain Life In Atlantic Ocean
Thought control: it's the computer world's latest game plan
Images of Iceland
The social psychology revolution is reaching its tipping point
Addicted to "clipmarks" in vacation..
1998: Syphilis Genome Sequenced; 2008: Syphilis on the Rise
10 Most Amazing Ghost Towns
Tibetan Flags Banned at Olympics
Scientists find why we need to re-read a page
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://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/7732456e-58d8-4441-8651-28b401c470ab/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://content8.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>
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
Blog
Copyright
Privacy
EULA
OK