Created attachment 29612 [details] Assertion doesnt work with \Q and \E Main use-case: escape spatial (for regular expressions) characters from content of variables (see stack overflow topic for details: http://stackoverflow.com/q/13472646/1387438 . "\Q" and "\E" marks doesn't work for "Response Assertion" and "Regular Expression Extractor". I'm inducing minimal test case showing the problem. Run test plan included. Go to "View Results Tree" Select assertion (it is failed). copy regular expression "google.time\Q()\E" go to request select response now test this regular expression and it will find match so it works in this response! "\Q" and "\E" can surround anything (not only regular expression special characters) and problems always appears.
Bugzilla isn't a support forum. Please use the JMeter user mailing. Tips: JMeter uses Jakarta ORO for his RegExp engine (not Java RegExp) http://jmeter.apache.org/usermanual/regular_expressions.html
Ok. I missed this in documentation, but I've found there: 20.6 Testing Regular Expressions Since JMeter 2.4, the listener View Results Tree include a RegExp Tester to test regular expressions directly on sampler response data. As I wrote: this regular expression (containing \Q\E) works in "View Results Tree", so there is definitely some incoherency how regular expressions works in JMeter and that is why I threated this as a bug.
The Regexp Tester uses the same Regex engine, i.e. Jakarta ORO. I just tried using JMeter 2.8, and \Q and \E do *not* work.
Created attachment 29617 [details] Screenshot showing that \Q \E works in "View Results Tree" Some magic happens or we are talking about different things, it works in my "View Results Tree", see screenshot.
I was using the Regexp Tester. You were using the Search faciliry, which uses the Java regex engine.
I find this a little disturbing for users. Shouldn't we either: - Replace java regexp engine from search feature by oro - Or replace oro by java engine regexp but this is an issue for existing Test Plans
With next version of JMeter (5.5) we will have a switch (jmeter.regex.engine=java), that can be used to replace all occurrences of Oro with Java's regex implementation. Therefore I think, this bug is now a duplicate of 57672. *** This bug has been marked as a duplicate of bug 57672 ***
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2990