Pal
Pal

Reputation: 235

issue in regular expression in jmeter

I marked one peculiar thing in regular expression in jmeter:

My aim is to capture a substring of the following text (marked in bold) using regular expressions. For this I tried the following:

  1. I have selected “Text” from the “View Result tree” box and click on “Regular Expression” check box and then use regular expression viewstate\|/(.+?)= This is working fine.
  2. But the same regular expression is not working when I am using “RegExp Tester” from drop down.

VIEWSTATE|/wEPDwUJMjUyODUxNTQzEGRkFgJmD2QWAgIED2QWBAIJDw8WAh4EVGV4dAWKATxiPldlbGNvbWUmbmJzcDs8L2I+WFlaIEVGRzgxNzEgQUJDPGI+Jm5ic3A7QXMmbmJzcDs8L2I+UmFkaW9sb2dpc3Q8YnIgLz48Yj5EYXRlOiAmbmJzcDs8L2I+MTktQXByLTIwMTI8Yj4mbmJzcDtMb2NhdGlvbjombmJzcDs8L2I+ TU1QaGFybWFjeTEkZGdyTU0PZ2Q=

Any Idea why this is happening like this ?

Upvotes: 0

Views: 450

Answers (1)

Tim Pietzcker
Tim Pietzcker

Reputation: 336368

Just a shot in the dark: Try viewstate\|\/(.+?)= and see if that works.

The rationale behind my guess: / might get misinterpreted as the regex delimiter, cutting short your regex.

Another idea (which would help if there were newlines in the input string that the . isn't matching):

viewstate\|\/([^=]+)

Upvotes: 2

Related Questions