Created
July 15, 2016 14:35
-
-
Save anonymous/6ac84c4b016b9060153351ec205894c3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1.9.3-p551 :041 > txt = <<eof | |
1.9.3-p551 :042"> slow_query_log | |
1.9.3-p551 :043"> slow_query_log_file = slow-log | |
1.9.3-p551 :044"> long_query_time = 13 | |
1.9.3-p551 :045"> min_examined_row_limit = 42 | |
1.9.3-p551 :046"> log-queries-not-using-indexes = 1 | |
1.9.3-p551 :047"> eof | |
=> "slow_query_log\nslow_query_log_file = slow-log\nlong_query_time = 13\nmin_examined_row_limit = 42\nlog-queries-not-using-indexes = 1\n" | |
1.9.3-p551 :048 > 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 | |
=> /.*slow_query_log.*slow_query_log_file = slow-log.*long_query_time = 13.*min_examined_row_limit = 42.*log-queries-not-using-indexes = .*/m | |
1.9.3-p551 :049 > regex2 = %r{ | |
1.9.3-p551 :050/> .*slow_query_log.* | |
1.9.3-p551 :051/> slow_query_log_file = slow-log.* | |
1.9.3-p551 :052/> long_query_time = 13.* | |
1.9.3-p551 :053/> min_examined_row_limit = 42.* | |
1.9.3-p551 :054/> log-queries-not-using-indexes = .* | |
1.9.3-p551 :055/> }xm | |
=> / | |
.*slow_query_log.* | |
slow_query_log_file = slow-log.* | |
long_query_time = 13.* | |
min_examined_row_limit = 42.* | |
log-queries-not-using-indexes = .* | |
/mx | |
1.9.3-p551 :056 > regex1.match txt | |
=> #<MatchData "slow_query_log\nslow_query_log_file = slow-log\nlong_query_time = 13\nmin_examined_row_limit = 42\nlog-queries-not-using-indexes = 1\n"> | |
1.9.3-p551 :057 > regex2.match txt | |
=> nil | |
1.9.3-p551 :058 > |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment