re = /(?:call|CALL)[\ *](?:(?:system|"system").(?:runtime|"runtime").(?:kill_query|"kill_query"))/m
str = 'CALL system.runtime.kill_query(query_id => \'20211003_215635_15007_n3mb3\', message => \'Looker query cancel.\')
CALL "system"."runtime"."kill_query"(query_id => \'20211003_215635_15007_n3mb3\', message => \'Looker query cancel.\')
CALL "system".runtime."kill_query"(query_id => \'20211003_215635_15007_n3mb3\', message => \'Looker query cancel.\')
CALL "system"."runtime"."kill_query"(\'20211003_215635_15007_n3mb3\', \'afsd\')
CALL "system"."runtime"."kill_query"(message => \'20211003_215635_15007_n3mb3\', query_id => \'afsd\')
CALL+"system"."runtime"."kill_query"(message => \'20211003_215635_15007_n3mb3\', query_id => \'afsd\')'
# Print the match result
str.scan(re) do |match|
puts match.to_s
end
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Ruby, please visit: http://ruby-doc.org/core-2.2.0/Regexp.html