<p>Actually, Sean, that&#39;s probably a good idea, since ^0 would match alpha characters, too...</p>
<p>-Avi</p>
<div class="gmail_quote">On Mar 12, 2014 2:16 AM, &quot;Sean Devoy&quot; &lt;<a href="mailto:sdevoy@bizfocused.com">sdevoy@bizfocused.com</a>&gt; wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">






<div lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span style="font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#44546a">Whoa!!!&nbsp; Thanks Avi &ndash; the light came on.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#44546a">The first ^0 means &ldquo;starts with a ZERO&rdquo;, but the second ^0 means &ldquo;anything BUT a zero&rdquo;!!!!&nbsp; There are always multiple ways to &ldquo;regex&rdquo; something, I probably would have gone with
 ^0([1-9]\d+)$.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#44546a">Learned something.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#44546a">Thanks,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#44546a">Sean<u></u><u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;">From:</span></b><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;"> <a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank">freeswitch-users-bounces@lists.freeswitch.org</a> [mailto:<a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank">freeswitch-users-bounces@lists.freeswitch.org</a>]
<b>On Behalf Of </b>Avi Marcus<br>
<b>Sent:</b> Tuesday, March 11, 2014 6:18 PM<br>
<b>To:</b> FreeSWITCH Users Help<br>
<b>Subject:</b> Re: [Freeswitch-users] Matching destination number<u></u><u></u></span></p>
<p class="MsoNormal"><u></u>&nbsp;<u></u></p>
<p>Only matcha 0 followed by a non zero.<br>
That way only one of the ref ex matches.<u></u><u></u></p>
<p>-Avi<u></u><u></u></p>
<div>
<p class="MsoNormal">On Mar 11, 2014 11:21 PM, &quot;Sean Devoy&quot; &lt;<a href="mailto:sdevoy@bizfocused.com" target="_blank">sdevoy@bizfocused.com</a>&gt; wrote:<u></u><u></u></p>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#44546a">Hi,</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#44546a">&nbsp;</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#44546a">Please explain what the [^0] does in that regex -
</span>^0([^0]\d+)$<u></u><u></u></p>
<p class="MsoNormal"><span style="font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#44546a">&nbsp;</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#44546a">Sean</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#44546a">&nbsp;</span><u></u><u></u></p>
<div>
<div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;">From:</span></b><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;">
<a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank">freeswitch-users-bounces@lists.freeswitch.org</a> [mailto:<a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank">freeswitch-users-bounces@lists.freeswitch.org</a>]
<b>On Behalf Of </b>mbo<br>
<b>Sent:</b> Tuesday, March 11, 2014 4:12 PM<br>
<b>To:</b> FreeSWITCH Users Help<br>
<b>Subject:</b> Re: [Freeswitch-users] Matching destination number</span><u></u><u></u></p>
</div>
</div>
<p class="MsoNormal">&nbsp;<u></u><u></u></p>
<p class="MsoNormal">That works,&nbsp;<u></u><u></u></p>
<div>
<p class="MsoNormal">&nbsp;<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Thanks!<u></u><u></u></p>
</div>
<div>
<div>
<div>
<p class="MsoNormal">&nbsp;<u></u><u></u></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">Markus<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">&nbsp;<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Am 11.03.2014 um 20:49 schrieb Avi Marcus &lt;<a href="mailto:avi@avimarcus.net" target="_blank">avi@avimarcus.net</a>&gt;:<u></u><u></u></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><u></u>&nbsp;<u></u></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal">Both are matching.<u></u><u></u></p>
<div>
<p class="MsoNormal">You might want this for your second match, so that there&#39;s only 1x leading zero:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">&nbsp;<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">^0([^0]\d+)$<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">&nbsp;<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><br clear="all">
<u></u><u></u></p>
<div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;">-Avi</span><u></u><u></u></p>
</div>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">&nbsp;<u></u><u></u></p>
<div>
<p class="MsoNormal">On Tue, Mar 11, 2014 at 8:49 PM, mbo &lt;<a href="mailto:mbodbg@gmx.net" target="_blank">mbodbg@gmx.net</a>&gt; wrote:<u></u><u></u></p>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<div>
<div>
<p class="MsoNormal">Hello,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">&nbsp;<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">I have the following dial plan:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">&nbsp;<u></u><u></u></p>
</div>
<div>
<div>
<p class="MsoNormal" style="background:black">
<span style="font-size:10.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#34bbc7">&lt;extension</span><span style="font-size:10.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#34bd26"> name=&quot;international destination_number&quot; continue=&quot;true&quot;</span><span style="font-size:10.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#34bbc7">&gt;</span><u></u><u></u></p>

</div>
<div>
<p class="MsoNormal" style="background:black">
<span style="font-size:10.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#008f00">&nbsp; &nbsp; &nbsp; </span>
<span style="font-size:10.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#34bbc7">&lt;condition</span><span style="font-size:10.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#34bd26"> field=&quot;destination_number&quot; expression=&quot;^00(\d+)$&quot;</span><span style="font-size:10.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#34bbc7">&gt;</span><u></u><u></u></p>

</div>
<div>
<p class="MsoNormal" style="background:black">
<span style="font-size:10.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#008f00">&nbsp; &nbsp; &nbsp; &nbsp; </span>
<span style="font-size:10.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#34bbc7">&lt;action</span><span style="font-size:10.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#34bd26"> application=&quot;log&quot; data=&quot;CONSOLE *** international number ${destination_number} ***&quot;/</span><span style="font-size:10.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#34bbc7">&gt;</span><u></u><u></u></p>

</div>
<div>
<p class="MsoNormal" style="background:black">
<span style="font-size:10.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#008f00">&nbsp; &nbsp; &nbsp; &nbsp; </span>
<span style="font-size:10.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#34bbc7">&lt;action</span><span style="font-size:10.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#34bd26"> application=&quot;set_profile_var&quot; data=&quot;destination_number=$1&quot;/</span><span style="font-size:10.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#34bbc7">&gt;</span><u></u><u></u></p>

</div>
<div>
<p class="MsoNormal" style="background:black">
<span style="font-size:10.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#008f00">&nbsp; &nbsp; &nbsp; </span>
<span style="font-size:10.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#34bbc7">&lt;/condition&gt;</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="background:black">
<span style="font-size:10.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#008f00">&nbsp; &nbsp; </span>
<span style="font-size:10.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#34bbc7">&lt;/extension&gt;</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="background:black">
<span style="font-size:10.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#008f00">&nbsp;</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="background:black">
<span style="font-size:10.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#008f00">&nbsp; &nbsp; </span>
<span style="font-size:10.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#34bbc7">&lt;extension</span><span style="font-size:10.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#34bd26"> name=&quot;national destination_number&quot; continue=&quot;true&quot;</span><span style="font-size:10.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#34bbc7">&gt;</span><u></u><u></u></p>

</div>
<div>
<p class="MsoNormal" style="background:black">
<span style="font-size:10.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#008f00">&nbsp; &nbsp; &nbsp; </span>
<span style="font-size:10.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#34bbc7">&lt;condition</span><span style="font-size:10.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#34bd26"> field=&quot;destination_number&quot; expression=&quot;^0(\d+)$&quot;</span><span style="font-size:10.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#34bbc7">&gt;</span><u></u><u></u></p>

</div>
<div>
<p class="MsoNormal" style="background:black">
<span style="font-size:10.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#008f00">&nbsp; &nbsp; &nbsp; &nbsp; </span>
<span style="font-size:10.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#34bbc7">&lt;action</span><span style="font-size:10.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#34bd26"> application=&quot;log&quot; data=&quot;CONSOLE *** international number ${destination_number}&quot;/</span><span style="font-size:10.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#34bbc7">&gt;</span><u></u><u></u></p>

</div>
<div>
<p class="MsoNormal" style="background:black">
<span style="font-size:10.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#008f00">&nbsp; &nbsp; &nbsp; &nbsp; </span>
<span style="font-size:10.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#34bbc7">&lt;action</span><span style="font-size:10.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#34bd26"> application=&quot;set_profile_var&quot; data=&quot;destination_number=49$1&quot;/</span><span style="font-size:10.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#34bbc7">&gt;</span><u></u><u></u></p>

</div>
<div>
<p class="MsoNormal" style="background:black">
<span style="font-size:10.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#008f00">&nbsp; &nbsp; &nbsp; </span>
<span style="font-size:10.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#34bbc7">&lt;/condition&gt;</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="background:black">
<span style="font-size:10.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#008f00">&nbsp; &nbsp; </span>
<span style="font-size:10.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#34bbc7">&lt;/extension&gt;</span><u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal">&nbsp;<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">&nbsp;<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">If I dial number 001234567, I get the following output in the console:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">&nbsp;<u></u><u></u></p>
</div>
<div>
<div>
<p class="MsoNormal" style="background:black">
<span style="font-size:10.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#008f00">2014-03-11 19:43:42.945392 [CONSOLE] mod_dptools.c:1569 *** international number 001234567 ***</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="background:black">
<span style="font-size:10.5pt;font-family:&quot;Menlo&quot;,&quot;serif&quot;;color:#008f00">2014-03-11 19:43:42.945392 [CONSOLE] mod_dptools.c:1569 *** international number 1234567</span><u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal">&nbsp;<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">The second extension is matching, however in the first extension the destination_number has been overridden and does not have any leading zeros. Why is it matching anyway?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">&nbsp;<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Thanks<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">&nbsp;<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Markus<u></u><u></u></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">&nbsp;<u></u><u></u></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com/" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com/" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org/" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org</a><u></u><u></u></p>
</blockquote>
</div>
<p class="MsoNormal">&nbsp;<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal">_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><u></u><u></u></p>
</blockquote>
</div>
<p class="MsoNormal">&nbsp;<u></u><u></u></p>
</div>
</div>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><u></u><u></u></p>
</blockquote>
</div>
</div>
</div>

<br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div>