Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[Freeswitch-users] confuse of regex command with "|"


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users
View previous topic :: View next topic  
Author Message
dujinfang at gmail.com
Guest





PostPosted: Sat Sep 26, 2009 10:55 pm    Post subject: [Freeswitch-users] confuse of regex command with "|&quo Reply with quote

Hi, is this a bug?

freeswitch@internal> regex "10"|"09|10"
false
freeswitch@internal> regex "10"|"10"
true
freeswitch@internal> regex "10"|"(09|10)"
false
freeswitch@internal> 2009-09-27 11:47:00.815355 [ERR] switch_regex.c:101 COMPILE ERROR: 4 [missing )]["(09]


the first one should be true?
Back to top
msc at freeswitch.org
Guest





PostPosted: Mon Sep 28, 2009 11:25 am    Post subject: [Freeswitch-users] confuse of regex command with "|&quo Reply with quote

On Sat, Sep 26, 2009 at 8:45 PM, Seven Du <dujinfang@gmail.com (dujinfang@gmail.com)> wrote:
Quote:
Hi, is this a bug?

freeswitch@internal> regex "10"|"09|10"
false
freeswitch@internal> regex "10"|"10"
true
freeswitch@internal> regex "10"|"(09|10)"
false
freeswitch@internal> 2009-09-27 11:47:00.815355 [ERR] switch_regex.c:101 COMPILE ERROR: 4 [missing )]["(09]


the first one should be true?

_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (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



Try adding a backslash in front of the pipe so that the regex command does not view the pipe as a data delimiter:
freeswitch@internal> regex "10"|"09\|10"
true

Let us know if you get it working for your needs.
-MC
Back to top
brian at freeswitch.org
Guest





PostPosted: Mon Sep 28, 2009 11:39 am    Post subject: [Freeswitch-users] confuse of regex command with "|&quo Reply with quote

Yep escape it.

/b

On Sep 28, 2009, at 10:47 AM, Michael Collins wrote:

Quote:
regex "10"|"09\|10"


_______________________________________________
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
Back to top
dujinfang at gmail.com
Guest





PostPosted: Mon Sep 28, 2009 8:35 pm    Post subject: [Freeswitch-users] confuse of regex command with "|&quo Reply with quote

Thanks. But I think it would be nicer if the regex looks the same as in dialplan. can we add a optional separator arg on this case?

regex <data>|<pattern> [seperator]
regex "10":"09|10" :

2009/9/29 Brian West <brian@freeswitch.org (brian@freeswitch.org)>
Quote:
Yep escape it.

/b

On Sep 28, 2009, at 10:47 AM, Michael Collins wrote:

Quote:
regex "10"|"09\|10"



_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (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


Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services