Last active
December 11, 2015 04:39
-
-
Save 166MMX/4547129 to your computer and use it in GitHub Desktop.
Fancy RegEx to match string concatenation for a log message. Something like logger.warn("badaboom " + ex1.message, ex2);
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
\w+?(?:\.(?:trace|debug|info|warn|error)|\[(?:'(?:trace|debug|info|warn|error)'|"(?:trace|debug|info|warn|error)")\])\((?:"(?:[^\\"]|\\\\|\\")*?"|'(?:[^\\']|\\\\|\\')*?'|[^'"\(\)])+\+(?:"(?:[^\\"]|\\\\|\\")*?"|'(?:[^\\']|\\\\|\\')*?'|[^'"\(\)])+\) |
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
\w+? | |
(?: | |
\. | |
(?:trace|debug|info|warn|error)| | |
\[ | |
(?: | |
'(?:trace|debug|info|warn|error)'| | |
"(?:trace|debug|info|warn|error)" | |
) | |
\] | |
) | |
\( | |
(?: | |
"(?:[^\\"]|\\\\|\\")*?"| | |
'(?:[^\\']|\\\\|\\')*?'| | |
[^'"\(\)] | |
)+ | |
\+ | |
(?: | |
"(?:[^\\"]|\\\\|\\")*?"| | |
'(?:[^\\']|\\\\|\\')*?'| | |
[^'"\(\)] | |
)+ | |
\) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment