Skip to content

Instantly share code, notes, and snippets.

Created July 15, 2016 15:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/28df35cb1364d91c12212b290f312b81 to your computer and use it in GitHub Desktop.
Save anonymous/28df35cb1364d91c12212b290f312b81 to your computer and use it in GitHub Desktop.
txt = <<eof
slow_query_log
slow_query_log_file = slow-log
long_query_time = 13
min_examined_row_limit = 42
log-queries-not-using-indexes = 1
eof
regex1 = /.*slow_query_log.*slow_query_log_file = slow-log.*long_query_time = 13.*min_examined_row_limit = 42.*log-queries-not-using-indexes = .*/m
regex2 = %r{
.*slow_query_log.*
slow_query_log_file = slow-log.*
long_query_time = 13.*
min_examined_row_limit = 42.*
log-queries-not-using-indexes = .*
}xm
regex1.match txt
=> MAtchData.......
regex2.match txt
=> nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment