Re: [SR-Users] regular expression question

2016-12-14 Thread Daniel Tryba
On Tue, Dec 13, 2016 at 03:25:12PM -0500, Satish Patel wrote: > It works! but it doesn't work when i tried to use with wildcard (*) like > > if(!($ua =~ "*Foo")){ This is not a valid regular expression. A regexp wildcard is any character (.) zero or more times (*): .* Though I suspected above co

Re: [SR-Users] regular expression question

2016-12-13 Thread Satish Patel
It works! but it doesn't work when i tried to use with wildcard (*) like if(!($ua =~ "*Foo")){ On Sat, Dec 10, 2016 at 1:24 AM, Brandon Armstead wrote: > if(!($ua =~ "")){ > On Fri, Dec 9, 2016 at 7:04 AM Satish Patel wrote: >> >> I am trying to block SIP scanner so i am trying to use following

Re: [SR-Users] regular expression question

2016-12-09 Thread Brandon Armstead
if(!($ua =~ "")){ On Fri, Dec 9, 2016 at 7:04 AM Satish Patel wrote: > I am trying to block SIP scanner so i am trying to use following logic > > only allow "My-UserAgent" and block rest but its throwing error, but > > if i use =~ regular expression which works! why negative match > > doesn't wo

[SR-Users] regular expression question

2016-12-09 Thread Satish Patel
I am trying to block SIP scanner so i am trying to use following logic only allow "My-UserAgent" and block rest but its throwing error, but if i use =~ regular expression which works! why negative match doesn't work? if($ua !~ "(My-UserAgent") { xlog("L_INFO","On more scriptkid