[Freeswitch-users] [FS Unable to evaluate large regex]

Tihomir Culjaga tculjaga at gmail.com
Thu Dec 22 13:11:55 MSK 2016


this looks like a local number portability to me. And trying to regex this
is a mission impossible.

while there are many ways to address the topic, id suggest you to go with
mod_lcr or with mod_curl ...
either way, you put your numbering plan (every number) in a database and
try to get the destination switch with a simple query.

Hope it helped!

regards,
Tihomir.

On 22 December 2016 at 05:41, Bilal Abbasi <bilaln018 at gmail.com> wrote:

> Actually that is much needed, the reason i have so much expressions,just
> to inform that we are integrating with the national providers regional
> switches, so we have to determine the dialed_number's region and transfer
> that to appropriate swith.
> Thanks for your time, i will try xml_curl surely...:-)
>
> Regards
> Abbasi
>
> On Wed, Dec 21, 2016 at 7:56 PM, Brian West <brian at freeswitch.org> wrote:
>
>> https://regex101.com/r/0IR0N5/1
>>
>> You should probably avoid such convoluted regular expressions, You'll
>> only cause brain fry trying to keep all that in your head correct.
>> Simplify and create more than one if you have that complex of a condition
>> you may need to switch to xml_curl as Ken has pointed out.
>>
>> /b
>>
>>
>>
>>
>> On Wed, Dec 21, 2016 at 12:12 AM, Ken Rice <krice at freeswitch.org> wrote:
>>
>>> This is one of those things where you probably need to be looking at
>>> either using more regexes or even looking going beyond the basic dialplan
>>> and into things like xml_curl or other more advance call processing
>>> mechanism
>>>
>>>
>>>
>>>
>>>
>>> *From:* freeswitch-users-bounces at lists.freeswitch.org [mailto:
>>> freeswitch-users-bounces at lists.freeswitch.org] *On Behalf Of *Bilal
>>> Abbasi
>>> *Sent:* Tuesday, December 20, 2016 11:40 PM
>>> *To:* FreeSWITCH Users Help <freeswitch-users at lists.freeswitch.org>
>>> *Subject:* Re: [Freeswitch-users] [FS Unable to evaluate large regex]
>>>
>>>
>>>
>>> Hi Brain,
>>>
>>> With above given example, i want to match 03135082344, that went
>>> perfect, but when i append some more REGEX with this like below
>>>
>>>
>>>
>>> (^(0092|\+92|92|0)312(9([0-9][0-9])|5([0-9][0-9])|0(0[59]|1[
>>> 59]|5[0-9]|8[56789]|9[0-9])|1(5[0-9]|8[56789]|9[701234569]))
>>> [0-9]{4}$|^(0092|\+92|92|0)313(9([0-9][0-9])|5([0-9][0-9])|0
>>> (0[59]|1[59]|2[6789]|5[01234567]|8[56789]|9[01278934])|1(2[6
>>> 789]|5[01234567]|8[56789]|9[0-9]))[0-9]{4}$)
>>>
>>>
>>>
>>> i am unable to match 03135082344, and its getting failed.
>>>
>>>
>>>
>>> Cheers
>>>
>>>
>>>
>>> On Wed, Dec 21, 2016 at 5:01 AM, Brian West <brian at freeswitch.org>
>>> wrote:
>>>
>>> What exactly are you trying to accomplish with this and what are some
>>> examples of what you're trying to match?
>>>
>>>
>>>
>>> On Tue, Dec 20, 2016 at 11:32 AM, Bilal Abbasi <bilaln018 at gmail.com>
>>> wrote:
>>>
>>> Hi users,
>>>
>>> i am getting some weird regex problem with my FS, if you have your regex
>>> length in more then 3000 characters if does not accept that in the
>>> condition, i split my regex in around 2000 characters, now i can see that
>>> FS is unable to resolve the Below Regex in the condition( i have a lot of
>>> other concatenated with that)
>>>
>>>
>>>
>>> ^(0092|\+92|92|0)313(9([0-9][0-9])|5([0-9][0-9])|0(0[59]|1[5
>>> 9]|2[6789]|5[01234567]|8[56789]|9[01278934])|1(2[6789]|5[012
>>> 34567]|8[56789]|9[0-9]))[0-9]{4}$
>>>
>>>
>>>
>>> But when i try that alone in the condition that works, i even tried to
>>> execute the whole in online regex tester and that did worked, but not
>>> working on FS.
>>>
>>> There must be a length of regex in condition that FS can evaluate,
>>>
>>> So
>>>
>>> i) i want to know that length so i can split my regex even shorter.and
>>> FS can evaluate that.
>>>
>>> ii) How FS people will look into this issue, so they can guide/fix this
>>> issue.
>>>
>>>
>>>
>>> Regards
>>>
>>> Abbasi
>>>
>>>
>>>
>>> ____________________________________________________________
>>> _____________
>>> Professional FreeSWITCH Consulting Services:
>>> consulting at freeswitch.org
>>> http://www.freeswitchsolutions.com
>>>
>>> Official FreeSWITCH Sites
>>> http://www.freeswitch.org
>>> http://confluence.freeswitch.org
>>> http://www.cluecon.com
>>>
>>> FreeSWITCH-users mailing list
>>> FreeSWITCH-users at lists.freeswitch.org
>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>>> http://www.freeswitch.org
>>>
>>>
>>>
>>>
>>>
>>> --
>>>
>>> *Brian West*
>>> brian at freeswitch.org
>>>
>>> *Twitter: @FreeSWITCH , @briankwest*
>>> http://www.freeswitchbook.com (50% Discount using code FreeSwitch50)
>>> http://www.freeswitchcookbook.com (50% Discount using code FreeSwitch50)
>>> https://www.gofundme.com/freeswitch_ubuntu
>>>
>>> Got Bugs? Report them here <https://freeswitch.org/jira>! | Reddit:
>>> /r/freeswitch <https://www.reddit.com/r/freeswitch>
>>>
>>> *T:*+19184209001 <(918)%20420-9001> | *F:*+19184209002
>>> <(918)%20420-9002> | *M:*+1918424WEST (9378)
>>> *Skype:*briankwest
>>>
>>>
>>> ____________________________________________________________
>>> _____________
>>> Professional FreeSWITCH Consulting Services:
>>> consulting at freeswitch.org
>>> http://www.freeswitchsolutions.com
>>>
>>> Official FreeSWITCH Sites
>>> http://www.freeswitch.org
>>> http://confluence.freeswitch.org
>>> http://www.cluecon.com
>>>
>>> FreeSWITCH-users mailing list
>>> FreeSWITCH-users at lists.freeswitch.org
>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>>> http://www.freeswitch.org
>>>
>>>
>>>
>>> ____________________________________________________________
>>> _____________
>>> Professional FreeSWITCH Consulting Services:
>>> consulting at freeswitch.org
>>> http://www.freeswitchsolutions.com
>>>
>>> Official FreeSWITCH Sites
>>> http://www.freeswitch.org
>>> http://confluence.freeswitch.org
>>> http://www.cluecon.com
>>>
>>> FreeSWITCH-users mailing list
>>> FreeSWITCH-users at lists.freeswitch.org
>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>>> http://www.freeswitch.org
>>>
>>
>>
>>
>> --
>>
>> *Brian West*
>> brian at freeswitch.org
>>
>>
>> *Twitter: @FreeSWITCH , @briankwest*
>> http://www.freeswitchbook.com (50% Discount using code FreeSwitch50)
>> http://www.freeswitchcookbook.com (50% Discount using code FreeSwitch50)
>> https://www.gofundme.com/freeswitch_ubuntu
>>
>> Got Bugs? Report them here <https://freeswitch.org/jira>! | Reddit:
>> /r/freeswitch <https://www.reddit.com/r/freeswitch>
>>
>> *T:*+19184209001 <(918)%20420-9001> | *F:*+19184209002 <(918)%20420-9002>
>> | *M:*+1918424WEST (9378)
>> *Skype:*briankwest
>>
>> _________________________________________________________________________
>> Professional FreeSWITCH Consulting Services:
>> consulting at freeswitch.org
>> http://www.freeswitchsolutions.com
>>
>> Official FreeSWITCH Sites
>> http://www.freeswitch.org
>> http://confluence.freeswitch.org
>> http://www.cluecon.com
>>
>> FreeSWITCH-users mailing list
>> FreeSWITCH-users at lists.freeswitch.org
>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>> http://www.freeswitch.org
>>
>
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://confluence.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20161222/1c98e87c/attachment-0001.html 


Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list