<p>Actually, Sean, that'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, "Sean Devoy" <<a href="mailto:sdevoy@bizfocused.com">sdevoy@bizfocused.com</a>> 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:"Verdana","sans-serif";color:#44546a">Whoa!!! Thanks Avi – the light came on.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Verdana","sans-serif";color:#44546a">The first ^0 means “starts with a ZERO”, but the second ^0 means “anything BUT a zero”!!!! There are always multiple ways to “regex” something, I probably would have gone with
^0([1-9]\d+)$.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Verdana","sans-serif";color:#44546a">Learned something.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Verdana","sans-serif";color:#44546a">Thanks,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Verdana","sans-serif";color:#44546a">Sean<u></u><u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""> <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> <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, "Sean Devoy" <<a href="mailto:sdevoy@bizfocused.com" target="_blank">sdevoy@bizfocused.com</a>> 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:"Verdana","sans-serif";color:#44546a">Hi,</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-family:"Verdana","sans-serif";color:#44546a"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-family:"Verdana","sans-serif";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:"Verdana","sans-serif";color:#44546a"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-family:"Verdana","sans-serif";color:#44546a">Sean</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-family:"Verdana","sans-serif";color:#44546a"> </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:"Calibri","sans-serif"">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">
<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"> <u></u><u></u></p>
<p class="MsoNormal">That works, <u></u><u></u></p>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Thanks!<u></u><u></u></p>
</div>
<div>
<div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">Markus<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Am 11.03.2014 um 20:49 schrieb Avi Marcus <<a href="mailto:avi@avimarcus.net" target="_blank">avi@avimarcus.net</a>>:<u></u><u></u></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><u></u> <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's only 1x leading zero:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">^0([^0]\d+)$<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <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:"Verdana","sans-serif"">-Avi</span><u></u><u></u></p>
</div>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"> <u></u><u></u></p>
<div>
<p class="MsoNormal">On Tue, Mar 11, 2014 at 8:49 PM, mbo <<a href="mailto:mbodbg@gmx.net" target="_blank">mbodbg@gmx.net</a>> 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"> <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"> <u></u><u></u></p>
</div>
<div>
<div>
<p class="MsoNormal" style="background:black">
<span style="font-size:10.5pt;font-family:"Menlo","serif";color:#34bbc7"><extension</span><span style="font-size:10.5pt;font-family:"Menlo","serif";color:#34bd26"> name="international destination_number" continue="true"</span><span style="font-size:10.5pt;font-family:"Menlo","serif";color:#34bbc7">></span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="background:black">
<span style="font-size:10.5pt;font-family:"Menlo","serif";color:#008f00"> </span>
<span style="font-size:10.5pt;font-family:"Menlo","serif";color:#34bbc7"><condition</span><span style="font-size:10.5pt;font-family:"Menlo","serif";color:#34bd26"> field="destination_number" expression="^00(\d+)$"</span><span style="font-size:10.5pt;font-family:"Menlo","serif";color:#34bbc7">></span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="background:black">
<span style="font-size:10.5pt;font-family:"Menlo","serif";color:#008f00"> </span>
<span style="font-size:10.5pt;font-family:"Menlo","serif";color:#34bbc7"><action</span><span style="font-size:10.5pt;font-family:"Menlo","serif";color:#34bd26"> application="log" data="CONSOLE *** international number ${destination_number} ***"/</span><span style="font-size:10.5pt;font-family:"Menlo","serif";color:#34bbc7">></span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="background:black">
<span style="font-size:10.5pt;font-family:"Menlo","serif";color:#008f00"> </span>
<span style="font-size:10.5pt;font-family:"Menlo","serif";color:#34bbc7"><action</span><span style="font-size:10.5pt;font-family:"Menlo","serif";color:#34bd26"> application="set_profile_var" data="destination_number=$1"/</span><span style="font-size:10.5pt;font-family:"Menlo","serif";color:#34bbc7">></span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="background:black">
<span style="font-size:10.5pt;font-family:"Menlo","serif";color:#008f00"> </span>
<span style="font-size:10.5pt;font-family:"Menlo","serif";color:#34bbc7"></condition></span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="background:black">
<span style="font-size:10.5pt;font-family:"Menlo","serif";color:#008f00"> </span>
<span style="font-size:10.5pt;font-family:"Menlo","serif";color:#34bbc7"></extension></span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="background:black">
<span style="font-size:10.5pt;font-family:"Menlo","serif";color:#008f00"> </span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="background:black">
<span style="font-size:10.5pt;font-family:"Menlo","serif";color:#008f00"> </span>
<span style="font-size:10.5pt;font-family:"Menlo","serif";color:#34bbc7"><extension</span><span style="font-size:10.5pt;font-family:"Menlo","serif";color:#34bd26"> name="national destination_number" continue="true"</span><span style="font-size:10.5pt;font-family:"Menlo","serif";color:#34bbc7">></span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="background:black">
<span style="font-size:10.5pt;font-family:"Menlo","serif";color:#008f00"> </span>
<span style="font-size:10.5pt;font-family:"Menlo","serif";color:#34bbc7"><condition</span><span style="font-size:10.5pt;font-family:"Menlo","serif";color:#34bd26"> field="destination_number" expression="^0(\d+)$"</span><span style="font-size:10.5pt;font-family:"Menlo","serif";color:#34bbc7">></span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="background:black">
<span style="font-size:10.5pt;font-family:"Menlo","serif";color:#008f00"> </span>
<span style="font-size:10.5pt;font-family:"Menlo","serif";color:#34bbc7"><action</span><span style="font-size:10.5pt;font-family:"Menlo","serif";color:#34bd26"> application="log" data="CONSOLE *** international number ${destination_number}"/</span><span style="font-size:10.5pt;font-family:"Menlo","serif";color:#34bbc7">></span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="background:black">
<span style="font-size:10.5pt;font-family:"Menlo","serif";color:#008f00"> </span>
<span style="font-size:10.5pt;font-family:"Menlo","serif";color:#34bbc7"><action</span><span style="font-size:10.5pt;font-family:"Menlo","serif";color:#34bd26"> application="set_profile_var" data="destination_number=49$1"/</span><span style="font-size:10.5pt;font-family:"Menlo","serif";color:#34bbc7">></span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="background:black">
<span style="font-size:10.5pt;font-family:"Menlo","serif";color:#008f00"> </span>
<span style="font-size:10.5pt;font-family:"Menlo","serif";color:#34bbc7"></condition></span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="background:black">
<span style="font-size:10.5pt;font-family:"Menlo","serif";color:#008f00"> </span>
<span style="font-size:10.5pt;font-family:"Menlo","serif";color:#34bbc7"></extension></span><u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <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"> <u></u><u></u></p>
</div>
<div>
<div>
<p class="MsoNormal" style="background:black">
<span style="font-size:10.5pt;font-family:"Menlo","serif";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:"Menlo","serif";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"> <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"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Thanks<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <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"> <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"> <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"> <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>