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
293 views
tags:
programming
,
.net
,
linq
Add a Comment
Login
to Comment. Not a member yet?
Sign up
Related Clips
The Age of Thinking, Self-Developing Robot...
Alpha Sensory
Do You Have TiVo Guilt? You're Not Alone
Fake TV News Widespread and Undisclosed
Alan Colmes to Depart Top Rated Hannity & ...
Immersive Data Exploration
Sean Hannity Losing Colmes
More clips from
travislaborde
The Force...
How I’ve put my wife into SVN
THE SPOILED UNDER-30 CROWD!!!
Today's Top Clips
What pets do when we're at work.....
Thousands of New Species Discovered on Tiny Island
Made From Snow
Dog saves dog on freeway
Journey through the birth, life and death of stars..Amazing pictures
Is this the world's oldest living creature?
The oscillations of Rudolfo Llinás : Seeing a Brain Out of Rhythm
"State Secret: Thousands Secretly Sterilized"
Can our "private" Emotions follow general rules ?
"How The Nazis Stole Christmas"
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/1336a3cf-9f26-4275-946d-ee383187e79b/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://content9.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