<div dir="ltr"><a href="https://regex101.com/">https://regex101.com/</a> lets you compare the regular expression under PCRE, Javascript and Python.<br><div>Both PCRE and Python give the Catastrophic Backtracking error.  Javascript matches on sx... (the first two characters of the test string).</div><div><br></div><div>Guillermo</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 22, 2016 at 5:42 PM, Podrigal, Aron <span dir="ltr">&lt;<a href="mailto:aronp@guaranteedplus.com" target="_blank">aronp@guaranteedplus.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Python uses its own SRE engine. But it is fully compatible with PCRE. Also I tested it with node /Javascript and that produces the same result as in python. <div><br></div><div>It seems like the library does some internal optimization and for the misleading false is because of its detection of catastrophic backtracking. And yes, that&#39;s great! </div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 22, 2016 at 3:17 PM, Brian West <span dir="ltr">&lt;<a href="mailto:brian@freeswitch.org" target="_blank">brian@freeswitch.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">What library does python use for regex?  We use libPCRE.</div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Thu, Sep 22, 2016 at 12:39 PM, Podrigal, Aron <span dir="ltr">&lt;<a href="mailto:aronp@guaranteedplus.com" target="_blank">aronp@guaranteedplus.com</a>&gt;</span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr"><div>Hi,</div><div><br></div><div>I just tried and compared regexs with python and freeswitch and the performance. I found it interesting </div><div><br></div><div>1) why in freeswitch the following is false</div><div><font face="monospace, monospace" color="#666666">freeswitch@internal&gt; regex sxsssssssssssssssssssssssa|(\S<wbr>+)+x</font></div><div><font face="monospace, monospace" color="#666666">false </font></div><div><div>2) (Probably the earlier is the answer) how does freeswitch solve this in less than a second, where in python / node it took around 23 seconds (on my machine).</div></div><br clear="all"><div><br></div><div>Thanks.</div><span><font color="#888888"><div><br></div>-- <br><div><div dir="ltr"><div><div dir="ltr">Aron Podrigal<div>-</div><div>&#39;1000001&#39;, &#39;1110010&#39;, &#39;1101111&#39;, &#39;1101110&#39;   &#39;1010000&#39;, &#39;1101111&#39;, &#39;1100100&#39;, &#39;1110010&#39;, &#39;1101001&#39;, &#39;1100111&#39;, &#39;1100001&#39;, &#39;1101100&#39;</div><div><br></div><div>P: &#39;2b&#39;, &#39;31&#39;, &#39;33&#39;, &#39;34&#39;, &#39;37&#39;, &#39;34&#39;, &#39;35&#39;, &#39;38&#39;, &#39;36&#39;, &#39;30&#39;, &#39;39&#39;, &#39;39&#39;<br></div><div><br></div></div></div></div></div>
</font></span></div>
<br></div></div>______________________________<wbr>______________________________<wbr>_____________<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" rel="noreferrer" target="_blank">http://www.freeswitchsolutions<wbr>.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://confluence.freeswitch.org" rel="noreferrer" target="_blank">http://confluence.freeswitch.o<wbr>rg</a><br>
<a href="http://www.cluecon.com" rel="noreferrer" 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.freeswi<wbr>tch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/ma<wbr>ilman/listinfo/freeswitch-user<wbr>s</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank">http://lists.frees<wbr>witch.org/mailman/options/free<wbr>switch-users</a><br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">







<p><font face="courier new, monospace"><b><i><font size="4">Brian West</font></i></b><br><span style="font-size:x-small"><a href="mailto:brian@freeswitch.org" target="_blank">brian@freeswitch.org</a></span></font></p>
<p><font size="1" face="courier new, monospace"><img src="http://billing.freeswitch.org/templates/default/img/whmcslogo.png"><br></font></p><p><font size="2" face="monospace, monospace"><b><i>Twitter: @FreeSWITCH , @briankwest</i></b><br><a href="http://www.freeswitchbook.com" target="_blank">http://www.freeswitchbook.com</a> <wbr>(50% Discount using code FreeSwitch50)<br><a href="http://www.freeswitchcookbook.com" target="_blank">http://www.freeswitchcookbook.<wbr>com</a> </font><span style="font-family:monospace,monospace;font-size:small">(50% Discount using code FreeSwitch50)</span><font size="2" face="monospace, monospace"><br></font><a href="https://www.gofundme.com/freeswitch_ubuntu" style="font-size:12.8px" target="_blank"><font face="monospace, monospace">https://www.gofundme.com/frees<wbr>witch_ubuntu</font></a></p><p><font face="monospace, monospace">Got Bugs? Report them <a href="https://freeswitch.org/jira" target="_blank">here</a>! | Reddit: <a href="https://www.reddit.com/r/freeswitch" target="_blank">/r/freeswitch</a></font></p>
<p><font size="2" face="monospace, monospace"><b>T:</b><a href="tel:%2B19184209001" value="+19184209001" target="_blank">+19184209001</a> | <b>F:</b><a href="tel:%2B19184209002" value="+19184209002" target="_blank">+19184209002</a> | <b>M:</b>+1918424WEST (9378)<br><b>iNUM:</b>+883 5100 1420 9001 | <b>ISN:</b>410*543 | <b>Skype:</b>briankwest</font></p></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
</div>
<br>______________________________<wbr>______________________________<wbr>_____________<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" rel="noreferrer" target="_blank">http://www.freeswitchsolutions<wbr>.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://confluence.freeswitch.org" rel="noreferrer" target="_blank">http://confluence.freeswitch.o<wbr>rg</a><br>
<a href="http://www.cluecon.com" rel="noreferrer" 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.freeswi<wbr>tch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/ma<wbr>ilman/listinfo/freeswitch-user<wbr>s</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank">http://lists.frees<wbr>witch.org/mailman/options/<wbr>freeswitch-users</a><br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr">Aron Podrigal<div>-</div><div>&#39;1000001&#39;, &#39;1110010&#39;, &#39;1101111&#39;, &#39;1101110&#39;   &#39;1010000&#39;, &#39;1101111&#39;, &#39;1100100&#39;, &#39;1110010&#39;, &#39;1101001&#39;, &#39;1100111&#39;, &#39;1100001&#39;, &#39;1101100&#39;</div><div><br></div><div>P: &#39;2b&#39;, &#39;31&#39;, &#39;33&#39;, &#39;34&#39;, &#39;37&#39;, &#39;34&#39;, &#39;35&#39;, &#39;38&#39;, &#39;36&#39;, &#39;30&#39;, &#39;39&#39;, &#39;39&#39;<br></div><div><br></div></div></div></div></div>
</div>
</div></div><br>______________________________<wbr>______________________________<wbr>_____________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" rel="noreferrer" target="_blank">http://www.<wbr>freeswitchsolutions.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://confluence.freeswitch.org" rel="noreferrer" target="_blank">http://confluence.freeswitch.<wbr>org</a><br>
<a href="http://www.cluecon.com" rel="noreferrer" 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.<wbr>freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/<wbr>mailman/listinfo/freeswitch-<wbr>users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank">http://lists.<wbr>freeswitch.org/mailman/<wbr>options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Guillermo Ruiz Camauer<br></div>
</div>