<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Dushyanth Jyothi &#187; Regular expressions</title>
	<atom:link href="http://dushi.co.uk/tag/regular-expressions/feed/" rel="self" type="application/rss+xml" />
	<link>http://dushi.co.uk</link>
	<description>Me, My Life and the Binary</description>
	<lastBuildDate>Sun, 18 Dec 2011 00:54:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>.net Regular Expressions String Match Replace</title>
		<link>http://dushi.co.uk/20/07/2009/net-regular-expressions-string-match-replace/</link>
		<comments>http://dushi.co.uk/20/07/2009/net-regular-expressions-string-match-replace/#comments</comments>
		<pubDate>Mon, 20 Jul 2009 13:14:57 +0000</pubDate>
		<dc:creator>Dushyanth Jyothi</dc:creator>
				<category><![CDATA[VB.net]]></category>
		<category><![CDATA[Regular expressions]]></category>
		<category><![CDATA[string match]]></category>
		<category><![CDATA[string replace]]></category>

		<guid isPermaLink="false">http://dushi.co.uk/?p=82</guid>
		<description><![CDATA[.net Regular Expressions String Match Replace String Match using regular expressions &#8211; VB.net Import Imports System.Text.RegularExpressions &#160; 'regularExpression_Match -&#62; regular expression pattern to macth Dim regularExpression_Match As New Regex&#40;&#34;(.*)REGULAR EXPRESSION MATCH PATTERN(.*)&#34;&#41; 'txtInput.txt -&#62; Text to macth against regularExpression_Match pattern Dim myMatch As Match = System.Text.RegularExpressions.Regex.Match&#40;txtInput.Text, regularExpression_Match&#41; If myMatch.Success Then 'Do Something End If&#60;/code&#62; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p><strong>.net Regular Expressions String Match Replace</strong></p>
<p><strong>String Match using regular expressions &#8211; VB.net</strong></p>

<div class="wp_syntax"><div class="code"><pre class="vbnet" style="font-family:monospace;">Import <span style="color: #0600FF;">Imports</span> System.<span style="color: #0000FF;">Text</span>.<span style="color: #0000FF;">RegularExpressions</span>
&nbsp;
            <span style="color: #008080; font-style: italic;">'regularExpression_Match -&gt; regular expression pattern to macth</span>
            <span style="color: #0600FF;">Dim</span> regularExpression_Match <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">New</span> Regex<span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;(.*)REGULAR EXPRESSION MATCH PATTERN(.*)&quot;</span><span style="color: #000000;">&#41;</span>
            <span style="color: #008080; font-style: italic;">'txtInput.txt -&gt; Text to macth against regularExpression_Match pattern</span>
            <span style="color: #0600FF;">Dim</span> myMatch <span style="color: #FF8000;">As</span> Match <span style="color: #008000;">=</span> System.<span style="color: #0000FF;">Text</span>.<span style="color: #0000FF;">RegularExpressions</span>.<span style="color: #0000FF;">Regex</span>.<span style="color: #0000FF;">Match</span><span style="color: #000000;">&#40;</span>txtInput.<span style="color: #0000FF;">Text</span>, regularExpression_Match<span style="color: #000000;">&#41;</span>
            <span style="color: #0600FF;">If</span> myMatch.<span style="color: #0000FF;">Success</span> <span style="color: #FF8000;">Then</span>
                <span style="color: #008080; font-style: italic;">'Do Something</span>
            <span style="color: #0600FF;">End</span> If&lt;<span style="color: #008000;">/</span>code&gt;
&nbsp;
&lt;code lang<span style="color: #008000;">=</span><span style="color: #808080;">&quot;vbnet[lines]&quot;</span>&gt;If Regex.<span style="color: #0000FF;">IsMatch</span><span style="color: #000000;">&#40;</span> userInputString, <span style="color: #808080;">&quot;\d+(\.?\d+)&quot;</span> <span style="color: #000000;">&#41;</span> <span style="color: #FF8000;">Then</span>
    <span style="color: #008080; font-style: italic;">' perform some conversion and math operations here</span>
<span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span> &lt;<span style="color: #008000;">/</span>code&gt;
&nbsp;
&nbsp;
&lt;strong&gt;String <span style="color: #0600FF;">Replace</span> using regular expressions <span style="color: #008000;">-</span> VB.<span style="color: #0000FF;">net</span>&lt;<span style="color: #008000;">/</span>strong&gt;
&nbsp;
&lt;code lang<span style="color: #008000;">=</span><span style="color: #808080;">&quot;vbnet&quot;</span>&gt;                    <span style="color: #0600FF;">Try</span>
                        <span style="color: #008080; font-style: italic;">'regularExpression_Replace -&gt; regular expression pattern to replace</span>
                        <span style="color: #0600FF;">Dim</span> regularExpression_Replace <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">New</span> Regex<span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;(.*)REGULAR EXPRESSION REPLACE PATTERN(.*)&quot;</span><span style="color: #000000;">&#41;</span>
                        <span style="color: #008080; font-style: italic;">'txtInput.txt -&gt; Text to macth and replace against </span>
                        <span style="color: #0600FF;">Dim</span> txtReplacementPattern <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">String</span>
                        txtReplacementPattern <span style="color: #008000;">=</span> <span style="color: #808080;">&quot;THIS WILL BE MY REPLACED TEXT&quot;</span>
                        <span style="color: #008080; font-style: italic;">'txtReplacementPattern = &quot;$$2 $$1&quot;</span>
                        txtInput.<span style="color: #0000FF;">Text</span> <span style="color: #008000;">=</span> regularExpression_Replace.<span style="color: #0600FF;">Replace</span><span style="color: #000000;">&#40;</span>txtInput.<span style="color: #0000FF;">Text</span>, _
                            txtReplacementPattern<span style="color: #000000;">&#41;</span>
                    <span style="color: #0600FF;">Catch</span> ex <span style="color: #FF8000;">As</span> Exception
                        Mess</pre></div></div>

<p><a href="http://msdn.microsoft.com/en-us/library/ms972966.aspx" target="_blank">Regular Expressions in ASP.NET</a></p>
]]></content:encoded>
			<wfw:commentRss>http://dushi.co.uk/20/07/2009/net-regular-expressions-string-match-replace/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

