Sorry for late reply Jan. The email was put into Forum section, not in my inbox, so I missed it. The diff is exactly what you fixed on Github, so no need for my diff. Next time I will send diff with mail too. Thank you, Nguyen. On Sun, Apr 29, 2018 at 4:37 AM, Jan Willamowius <jan@xxxxxxxxxxxxxx> wrote: > Hi Nguyen, > > yes, that seems to be a bug. > > Can you please mail me a diff for your change ? > > Thanks, > Jan > > -- > Jan Willamowius, Founder of the GNU Gatekeeper Project > EMail : jan@xxxxxxxxxxxxxx > Website: https://www.gnugk.org > Support: https://www.willamowius.com/gnugk-support.html > > Relaxed Communications GmbH > Frahmredder 91 > 22393 Hamburg > Geschäftsführer: Jan Willamowius > HRB 125261 (Amtsgericht Hamburg) > USt-IdNr: DE286003584 > > Nguyen Nam wrote: >> Hello, >> First time user here. I'm having trouble to get the regex in SQL >> routing to work. >> The sql itself is working okay, like this: >> >> 2018/04/28 21:45:35.741 5 gksql.cxx(323) Sql >> Executing query: (select alias,ip from routes where >> prefix=LEFT('8110201',3)) union (select 'reject' ,'ignore' ) Limit 1 >> 2018/04/28 21:45:35.742 5 tlibthrd.cxx(485) PTLib >> Started thread 0x7f7f28010bc0 (1473) Worker:0x7f7f51f67700 >> 2018/04/28 21:45:35.742 5 job.cxx(162) JOB Worker >> 140184812680960 started >> 2018/04/28 21:45:35.742 5 job.cxx(180) JOB >> Starting Job GkStatus at Worker thread 140184812680960 >> 2018/04/28 21:45:35.796 5 Routing.cxx(2198) Sql Query >> result : {\1}@aabbcc.com.vn, xxx.39.30.30 >> >> but the regex didnt work, so we have this alias: >> >> destinationAddress = 1 entries { >> [0]=url_ID "{\\1}@aabbcc.com.vn" >> } >> >> looking through the code at Routing.cxx, in SqlPolicy::RunPolicy, I >> think the current code apply regex when returned data only contain >> ONE column (like {\1}@aabbcc.com.vn). When 2 columns are returned, the >> code didnt check for regex at all. I did modify the code to support >> regex when 2 columns returned (regex alias + ip). >> >> Well it works for me, but not sure if it breaks any intended behavior? >> Regards, >> Nguyen > _______________________________________________________ > > Posting: mailto:gnugk-users@xxxxxxxxxxxxxxx > Archive: https://lists.gnugk.org/pipermail/gnugk-users/ > Unsubscribe: https://lists.gnugk.org/lists/listinfo/gnugk-users > Homepage: https://www.gnugk.org/ _______________________________________________________ Posting: mailto:gnugk-users@xxxxxxxxxxxxxxx Archive: https://lists.gnugk.org/pipermail/gnugk-users/ Unsubscribe: https://lists.gnugk.org/lists/listinfo/gnugk-users Homepage: https://www.gnugk.org/