0

I have a link in my Request -

example.com/people/3176972 

and my regular expression extractor is-

Regular expression: example.com/people/(.+?)

Template: $1$

Match no: 1

but it is only extracting only 3. I want to extract 3176972 number.

What am I doing wrong?

timbre timbre
  • 12,648
  • 10
  • 46
  • 77
arm
  • 441
  • 5
  • 20

3 Answers3

1

You should try this regular expression:

[0-9]+
victor sosa
  • 899
  • 13
  • 27
1

If you want to retrieve anything after the last slash, then just remove question mark from your expression:

example.com/people/(.+)

(question mark tells it to be non-greedy, hence it's taking 1 character).

If the last portion is always numeric, use

example.com/people/([0-9]+)
Community
  • 1
  • 1
timbre timbre
  • 12,648
  • 10
  • 46
  • 77
0

Amend your regular expression to look like example.com/people/(.*) or example.com/people/(\d+) as your regex stops after first match.

See Regular Expressions chapter of JMeter's User Manual for more information on JMeter Regular Expressions.

Convenient way of testing regular expressions is using "RegExp Tester" mode of the View Results Tree listener.

RegExp Tester

Check out How to debug your Apache JMeter script guide for more information on different debugging techniques for JMeter tests.

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
  • Thanks all for who responded. This is one of the best threads that I have seen. – arm May 04 '16 at 16:49