-1

Tried extracting values of multiple variables using regex101 and was able to do so, but on trying the same with Regular Expression Extractor unable to get extracted values.

I did google a lot on this and did quite a lot of trial and error but there was no luck or found anything similar on it.

input type='hidden' name='code' value='([A-Za-z0-9+= \-\_]+?)' \/>
<input type='hidden' name='id_token' value='(.*)' \/>
<input type='hidden' name='scope' value='(.*)' \/>
<input type='hidden' name='state' value='(.*)' \/>
<input type='hidden' name='session_state' value='(.*)' \/>

I want to extract value of below listed variables: 1.code 2.id_token 3.scope
4.state 5.session_state

Please refer : JMeter-RegExExtraction

and

101Extraction

  • You've select to use the `pcre` dialect while your actual tool uses `Perl`. I suspect it's just a matter of converting you pcre style regex to a Perl style regex. – Lieven Keersmaekers Dec 31 '18 at 11:45

1 Answers1

1
  1. My expectation is that you should be using a single Post-Processor for single value. Otherwise you will have to think of multiline regular expressions
  2. In general using regular expressions for parsing HTML is not the best idea as:

    • regular expressions are hard to develop and/or maintain
    • regular expressions are very fragile and sensitive to markup changes

So I would recommend going for CSS Selector Extractor instead, it is much easier, more human-readable and reliable than regular expressions approach:

enter image description here

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