try: ^((\d{10})\*(\d{6})\*(1|3|12)\*)$ you should get then: $1 - everything $2 - first 10-digit part $3 - second 6-digit number $4 - third - last part - extension
Hi Mariusz, Thanks for quick reply. Following is error i am getting while testing the same freeswitch@localhost.localdomain> regex 1234567890*123456*12*|^((\d{10})\*(\d{6})\*(1|3|12)\*)$ 1234567890*123456*12* 2013-07-01 12:33:58.980772 [ERR] switch_regex.c:101 COMPILE ERROR: 23 [missing )][^((\d{10})\*(\d{6})\*(1] freeswitch@localhost.localdomain> Thanks, -Vishal. On Mon, Jul 1, 2013 at 12:31 PM, Mariusz Czulada <manieq@wp.eu> wrote:
try: ^((\d{10})\*(\d{6})\*(1|3|12)\*)$ you should get then: $1 - everything $2 - first 10-digit part $3 - second 6-digit number $4 - third - last part - extension
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Weird, it looks right here: http://www.rubular.com/r/ZhdGrFCNRH (I took out the extra match on the entire string) I can't figure out why the regex command in fs_cli isn't working. (1|12) seems to break it... Should work in the dialplan, though. To help you understand why this would work... 1) Your main issue was trying to match the *, it needs to be escaped like \*. 2) You needed to wrap the matching parts in () 3) the [] match a single character from the set. So to mix matching 1 or 3 or 12 you need to put in (1|3|12) FreeSWITCH wiki has a pretty decent examples / intro to regex wiki page: http://wiki.freeswitch.org/wiki/Regex -Avi On Mon, Jul 1, 2013 at 10:08 AM, Vishal Kakkar <vishal.kakkar@gmail.com>wrote:
Hi Mariusz,
Thanks for quick reply. Following is error i am getting while testing the same
freeswitch@localhost.localdomain> regex 1234567890*123456*12*|^((\d{10})\*(\d{6})\*(1|3|12)\*)$
1234567890*123456*12* 2013-07-01 12:33:58.980772 [ERR] switch_regex.c:101 COMPILE ERROR: 23 [missing )][^((\d{10})\*(\d{6})\*(1] freeswitch@localhost.localdomain>
Thanks, -Vishal.
On Mon, Jul 1, 2013 at 12:31 PM, Mariusz Czulada <manieq@wp.eu> wrote:
try: ^((\d{10})\*(\d{6})\*(1|3|12)\*)$ you should get then: $1 - everything $2 - first 10-digit part $3 - second 6-digit number $4 - third - last part - extension
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@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@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
participants (3)
-
Avi Marcus
-
Mariusz Czulada
-
Vishal Kakkar