1
votes

I am using Jmeter and send http request that this is it's results:

<html><head></head><link rel='icon' href='data:;base64,iVBORw0KGgo='><body>Sorry, this is temporarily unavailable. (103)</body></html>

I want to save the code, meaning the 103.

I used regular expression extractor, and set it:

apply to: Main sample and sub sample

field to check: body

the problem is that I didn't success to found out what to put in the regula expression field.

Can someone please advise what is the regular expression to get the number 103?

enter image description here

enter image description here

1

1 Answers

1
votes

You may use

Sorry,[^<>]*\(([0-9]+)\)

See the regex demo

Details

  • Sorry, - a literal substring
  • [^<>]* - any 0+ chars other than < and >
  • \( - a ( char
  • ([0-9]+) - Capturing group 1: one or more digits
  • \) - a ) char.

Note that the template that you need to set is $1$ (you can even see that notation requirement in your screenshot).