<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Using Regular Expressions in Dynamics AX</title>
	<link>http://www.fourone.se/blog/2009/10/02/using-regular-expressions-in-dynamics-ax/</link>
	<description>Dynamics AX development blog</description>
	<pubDate>Thu, 09 Sep 2010 18:17:52 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
		<item>
		<title>By: G</title>
		<link>http://www.fourone.se/blog/2009/10/02/using-regular-expressions-in-dynamics-ax/#comment-12425</link>
		<dc:creator>G</dc:creator>
		<pubDate>Thu, 27 May 2010 10:18:03 +0000</pubDate>
		<guid>http://www.fourone.se/blog/2009/10/02/using-regular-expressions-in-dynamics-ax/#comment-12425</guid>
		<description>Could run server side Ax2009 to be assured .NET framework is there
e.g. class1 with validateEMail and main method for test

static server boolean validateEmail(EMail   _eMail)
{
    Str MatchEmailPattern = @"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$";
    System.Text.RegularExpressions.Match myMatch;
    boolean ret;
    ;
    // InteropPermission to execute COM/DLL object server side
    // Design priciple to have inside outermost exception handling structure try-catch-ttsscope to control state
    // new InteropPermission(InteropKind::ComInterop).assert();
    new InteropPermission(InteropKind::ClrInterop).assert();

    try
    {
        myMatch = System.Text.RegularExpressions.Regex::Match(_eMail, MatchEmailPattern);
        ret = myMatch.get_Success();

    }
    catch (Exception::Error)
    {

    }

    // Design priciple to have inside outermost exception handling structure try-catch-ttsscope to control state
    CodeAccessPermission::revertAssert();

    return ret;
}

public static void main(Args args)
{;
    Info(strFmt("%1", class1::validateEmail("nn@dr.dk")));
    Info(strFmt("%1", class1::validateEmail("nn@@dr.dk")));
}</description>
		<content:encoded><![CDATA[<p>Could run server side Ax2009 to be assured .NET framework is there<br />
e.g. class1 with validateEMail and main method for test</p>
<p>static server boolean validateEmail(EMail   _eMail)<br />
{<br />
    Str MatchEmailPattern = @&#8221;^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$&#8221;;<br />
    System.Text.RegularExpressions.Match myMatch;<br />
    boolean ret;<br />
    ;<br />
    // InteropPermission to execute COM/DLL object server side<br />
    // Design priciple to have inside outermost exception handling structure try-catch-ttsscope to control state<br />
    // new InteropPermission(InteropKind::ComInterop).assert();<br />
    new InteropPermission(InteropKind::ClrInterop).assert();</p>
<p>    try<br />
    {<br />
        myMatch = System.Text.RegularExpressions.Regex::Match(_eMail, MatchEmailPattern);<br />
        ret = myMatch.get_Success();</p>
<p>    }<br />
    catch (Exception::Error)<br />
    {</p>
<p>    }</p>
<p>    // Design priciple to have inside outermost exception handling structure try-catch-ttsscope to control state<br />
    CodeAccessPermission::revertAssert();</p>
<p>    return ret;<br />
}</p>
<p>public static void main(Args args)<br />
{;<br />
    Info(strFmt(&#8221;%1&#8243;, class1::validateEmail(&#8221;nn@dr.dk&#8221;)));<br />
    Info(strFmt(&#8221;%1&#8243;, class1::validateEmail(&#8221;nn@@dr.dk&#8221;)));<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rikard Gadolin</title>
		<link>http://www.fourone.se/blog/2009/10/02/using-regular-expressions-in-dynamics-ax/#comment-9519</link>
		<dc:creator>Rikard Gadolin</dc:creator>
		<pubDate>Tue, 17 Nov 2009 08:47:44 +0000</pubDate>
		<guid>http://www.fourone.se/blog/2009/10/02/using-regular-expressions-in-dynamics-ax/#comment-9519</guid>
		<description>Also i would try to run the method on the client instead of the server.</description>
		<content:encoded><![CDATA[<p>Also i would try to run the method on the client instead of the server.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rikard Gadolin</title>
		<link>http://www.fourone.se/blog/2009/10/02/using-regular-expressions-in-dynamics-ax/#comment-9518</link>
		<dc:creator>Rikard Gadolin</dc:creator>
		<pubDate>Tue, 17 Nov 2009 08:46:06 +0000</pubDate>
		<guid>http://www.fourone.se/blog/2009/10/02/using-regular-expressions-in-dynamics-ax/#comment-9518</guid>
		<description>Hello Brad.

I guess you mean the first method there.
I just tried it myself one more time to be sure, and it worked fine.
rikky@haxx.net returned true
rikky@haxx.nettt returned false

This was in AX 2009.
Make sure you have .NET framework installed!</description>
		<content:encoded><![CDATA[<p>Hello Brad.</p>
<p>I guess you mean the first method there.<br />
I just tried it myself one more time to be sure, and it worked fine.<br />
<a href="mailto:rikky@haxx.net">rikky@haxx.net</a> returned true<br />
<a href="mailto:rikky@haxx.nettt">rikky@haxx.nettt</a> returned false</p>
<p>This was in AX 2009.<br />
Make sure you have .NET framework installed!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brad</title>
		<link>http://www.fourone.se/blog/2009/10/02/using-regular-expressions-in-dynamics-ax/#comment-9511</link>
		<dc:creator>Brad</dc:creator>
		<pubDate>Mon, 16 Nov 2009 17:58:20 +0000</pubDate>
		<guid>http://www.fourone.se/blog/2009/10/02/using-regular-expressions-in-dynamics-ax/#comment-9511</guid>
		<description>This always returns 'false' for me, no matter what is entered.</description>
		<content:encoded><![CDATA[<p>This always returns &#8216;false&#8217; for me, no matter what is entered.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
