nkpalani
nkpalani

Reputation: 39

How to extract avoiding special characters using regular expression extractor in Jmeter

I am trying to extract XYZ from the below :

checkboxes__input' id='XYZ_2020-04-20' name='payment[invoices][XYZ][]' type='checkbox' value='2020-04-20'

using regular expression:

name='payment[invoices][(.*?)][]' type=

but it does not work. Can anyone please help me with this?

Upvotes: 0

Views: 656

Answers (1)

Dmitri T
Dmitri T

Reputation: 168122

As per JMeter Regular Expressions guide [ and ] are meta characters which stand for character classes therefore they need to be escaped with a backslash like:

name='payment\[invoices\]\[(.*?)\]\[\]' type=

Demo:

enter image description here


If you're not too comfortable with regular expressions you can consider switching to the Boundary Extractor where you can just provide left and right boundaries and it will extract everything between them:

enter image description here

Upvotes: 1

Related Questions