-1

As I am new in using jmeter I'm stuck to write regular expression for this expression:

/catalog/search_display?category_id=9">Parts</a>

Can somebody help me out.

halfer
  • 19,824
  • 17
  • 99
  • 186

2 Answers2

0
/catalog/search_display\?category_id=9">Parts</a>

Is that what you need? The question mark needs to be escaped, I don't see anything else noteworthy about it. The JMeter regexes are not enclosed in // and thus the slash is not a special character.

Tommi Kyntola
  • 704
  • 6
  • 8
0

What do you want to extract? I assume that it is 9 (category_id). In that case regular expression extractor configuration should look like:

  • Reference Name: anything meaningful, i.e. id
  • Regular Expression: <a href="/catalog/search_display\?category_id=(.+?)"
  • Template: $1$

Refer extracted value as ${id} where required.

Mention that question mark needs to be escaped by a back slash as it is reserved character in regular expressions.

See Regular Expressions chapter of JMeter's User Manual for Perl5-style regex syntax and examples.

Also be aware that it isn't very recommended to parse HTML using regular expressions and it might be better to use the following post processors instead:

Community
  • 1
  • 1
Dmitri T
  • 159,985
  • 5
  • 83
  • 133