288
288
# Unless specified the argument passed is a correct Regex pattern, we create a regex, escaping the strings and add wildcards and options
290
# For simple arguments having no special format, we simply add /.*/ on each side
291
for argument in [:team, :structure, :newname, :victim, :weapon, :text]
292
variables[argument] = Regexp.new('.*?' + Regexp.escape(variables[argument]) + '.*?', 'i') unless variables[argument].nil?
294
# For more formatted arguments, we define a specific Regex for each
290
295
name = Regexp.new('.*?' + Regexp.escape(name) + '.*?', 'i') unless name.nil?
291
296
ip = Regexp.new(Regexp.escape(ip) + '(\.?\d\d?\d?)*?') unless ip.nil?
292
297
guid = Regexp.new('[A-F0-9]*?' + Regexp.escape(guid)) unless guid.nil?
293
variables[:team] = Regexp.escape(variables[:team], 'i') unless variables[:team].nil?
294
variables[:structure] = Regexp.new('.*?' + Regexp.escape(variables[:structure]) + '.*?', 'i') unless variables[:structure].nil?
295
variables[:newname] = Regexp.new('.*?' + Regexp.escape(variables[:newname]) + '.*?', 'i') unless variables[:newname].nil?
296
variables[:victim] = Regexp.new('.*?' + Regexp.escape(variables[:victim]) + '.*?', 'i') unless variables[:victim].nil?
297
variables[:weapon] = Regexp.new('.*?' + Regexp.escape(variables[:weapon]) + '.*?', 'i') unless variables[:weapon].nil?
298
298
variables[:field] = Regexp.new(Regexp.escape(variables[:field]) + 's?', 'i') unless variables[:field].nil?
299
variables[:text] = Regexp.new('.*?' + Regexp.escape(variables[:text]) + '.*?', 'i') unless variables[:text].nil?
302
301
# Get the logs (whether the passed filename or the log itself on stdin)and call the class passing it as an argument