In this case the ? modifies the *, so there's .* (greedy) and .*? (not greedy) You want your .* to match as little as possible instead of as much as possible. If you use .* instead of .*? then your $2 would contain both the ndpi info but also it would have ";rn=18005551212" b/c the .* would grab all that stuff. The .*? would only grab up to the ";rn". Just adding that info for posterity's sake. :) -MC On Mon, Jan 7, 2013 at 5:05 PM, Ken Rice <krice@freeswitch.org> wrote:
Ooops yeah I mean .*... The ? Is pretty useless there... Since there should always be something if they send ndpi=
On 1/7/13 7:00 PM, "Michael Collins" <msc@freeswitch.org> wrote:
Just a quick FYI... be careful when you use .* because it will try to match EVERYTHING. Also, Ken accidentally typed (*.) which I'm sure wasn't what he was aiming for. ;)
Maybe this would be more effective: ^(?:+1|1)?([2-9]\d{2}[2-9]\d{6});ndpi=(.*?);rn=([2-9]\d{2}[2-9]\d{6})$
-MC
------------------------------ _________________________________________________________________________ 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
-- Ken *http://www.FreeSWITCH.org http://www.ClueCon.com http://www.OSTAG.org *irc.freenode.net #freeswitch
_________________________________________________________________________ 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
-- Michael S Collins Twitter: @mercutioviz http://www.FreeSWITCH.org http://www.ClueCon.com http://www.OSTAG.org