Search code examples
regexjmeterextractor

Regex extractor in JMeter to match text with multiple line breaks


I try to use Regular Expression Extractor in JMeter to match multiple lines with line breaks. It is a JSON formatted text, which is between textarea tags. I used this matcher in expression: ((.|\n|\r)*) , but got StackOverflowError.

Uncaught exception in thread Thread[Thread Group 1-1,6,main] java.lang.StackOverflowError: null at org.apache.oro.text.regex.Perl5Matcher.__match(Unknown Source) ~[oro-2.0.8.jar:?]


Solution

  • Try using the following regular expression:

    (?s)<textarea>(.+?)</textarea>
    

    enter image description here

    More information: JMeter Regular Expressions

    If you're not too comfortable with regular expressions you can consider switching to Boundary Extractor, it's sufficient to supply "left" and "right" boundaries and it will extract everything in-between