Try this pattern:
\[ORM\] - match
[\w\W]+?\wms - match any character (inlucding
\wms is found (
\w is a word character, can be digit as well) - non greedy, so it stops at first occurence of
\wms, so it won't capture until the second SQL log.
([\w\W]+?)\] - capturing group, that will contain full SQL statement, again non-greedy search for any character, similairly as above.