Skip to content

Instantly share code, notes, and snippets.

@166MMX
166MMX / gist:4547129
Last active December 11, 2015 04:39
Fancy RegEx to match string concatenation for a log message. Something like logger.warn("badaboom " + ex1.message, ex2);
\w+?(?:\.(?:trace|debug|info|warn|error)|\[(?:'(?:trace|debug|info|warn|error)'|"(?:trace|debug|info|warn|error)")\])\((?:"(?:[^\\"]|\\\\|\\")*?"|'(?:[^\\']|\\\\|\\')*?'|[^'"\(\)])+\+(?:"(?:[^\\"]|\\\\|\\")*?"|'(?:[^\\']|\\\\|\\')*?'|[^'"\(\)])+\)