Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MULTILINE && DOTALL flags for transform-patterns #474

Closed
GoogleCodeExporter opened this issue Jun 21, 2015 · 1 comment
Closed

MULTILINE && DOTALL flags for transform-patterns #474

GoogleCodeExporter opened this issue Jun 21, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

Sql requests typically consists of multiple lines of text, I think it would be 
useful to enable MULTILINE and DOTALL flags for regular expressions used to 
transform request description.

Here is patch implementing the feature.


diff --git a/src/main/java/net/bull/javamelody/FilterContext.java 
b/src/main/java/net/bull/javamelody/FilterContext.java
index 18c6e3f..f1c4ce7 100644
--- a/src/main/java/net/bull/javamelody/FilterContext.java
+++ b/src/main/java/net/bull/javamelody/FilterContext.java
@@ -172,7 +172,8 @@
            final Parameter parameter = Parameter.valueOfIgnoreCase(counter.getName()
                    + "_TRANSFORM_PATTERN");
            if (Parameters.getParameter(parameter) != null) {
-               final Pattern pattern = 
Pattern.compile(Parameters.getParameter(parameter));
+               final Pattern pattern = Pattern.compile(Parameters.getParameter(parameter),
+                       Pattern.MULTILINE + Pattern.DOTALL);
                counter.setRequestTransformPattern(pattern);
            }
        }

Original issue reported on code.google.com by michal.b...@gmail.com on 15 Apr 2015 at 12:39

@GoogleCodeExporter
Copy link
Author

This is committed in trunk (revision 4066) and ready for the next release 
(1.56).

Thanks Michal.

Original comment by evernat@free.fr on 20 Apr 2015 at 10:24

  • Changed state: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant