0

My HTML code is:

<a class="view-details-ul-none" href="javascript:printCertificate('11673191')">

I try this expression: href="javascript:printCertificate(\)|\(.*?)"> it return me the ID but along id number it return brackets and comma too, like below image:

When I pass this regular expression to next request as parameter my url become wrong and http send 500 http error code. because url looks like this:

GET https://Domain/path/completionCertificate.pdf?Id=('11673191')

Could anyone please help me in this would be appreciated.

Burhan Khalid
  • 169,990
  • 18
  • 245
  • 284
Asad
  • 49
  • 1
  • 3
  • 9

1 Answers1

0

Go for the following regular expression:

<a class="view-details-ul-none" href="javascript:printCertificate\('(\d+)'\)">

Demo:

JMeter Regex Demo

Remember to escape the following characters outside character classes:

.^$*+?()[{\|

and these inside the character classes:

^-]\

References:

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