Home Download Buy Blog Forum Support

DetectSyntax can now match all rules

DetectSyntax can now match all rules

Postby phillip.koebbe on Thu Oct 25, 2012 1:15 pm

If you've ever wanted to match all rules instead of just one, now you can. Here is a conjured up example:

Code: Select all
      {
         // This is an example of having to match all rules. In this example, the file needs to have a ruby
         // shebang *and* end in .ruby. If "match" == "all", DetectSyntax will set the named syntax only if all
         // rules match. If "match" is anything other than "all", the syntax will be set if any rule matches
         // (the normal behavior)
         "name": "Ruby",
         "match": "all",
         "rules": [
            {"binary": "ruby"},
            {"file_name": ".*\\.ruby$"}
         ]
      },


All existing rules should continue to work as they have. If anyone encounters any problems, please file an issue on GitHub [1] with an example file and the rule that broke. I'll look into as soon as I can.

[1] https://github.com/phillipkoebbe/DetectSyntax/issues
-- Phillip

Code: Select all
while self.living? do
    mistake = Mistake.new
    self.learn_from!(mistake) unless mistake.fatal?
end
phillip.koebbe
 
Posts: 208
Joined: Tue Dec 20, 2011 4:58 pm

Re: DetectSyntax can now match all rules

Postby facelessuser on Thu Oct 25, 2012 1:41 pm

Nice!
facelessuser
 
Posts: 1576
Joined: Tue Apr 05, 2011 7:38 pm

Re: DetectSyntax can now match all rules

Postby phillip.koebbe on Thu Oct 25, 2012 2:38 pm

facelessuser wrote:Nice!


Coming from you, Isaac, that means a lot!
-- Phillip

Code: Select all
while self.living? do
    mistake = Mistake.new
    self.learn_from!(mistake) unless mistake.fatal?
end
phillip.koebbe
 
Posts: 208
Joined: Tue Dec 20, 2011 4:58 pm


Return to Plugin Announcements

Who is online

Users browsing this forum: No registered users and 2 guests