jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gareth Western <>
Subject Regex to extract hidden input AND url parameter
Date Thu, 26 Jan 2006 15:58:18 GMT
Hi All,

I'm trying to write a regular expression to extract the value for a variable
from each HTML response in my test script. This value is dynamically generated
for each page, and can either be a hidden input (ie in a form) or a parameter
on the end of a link.

The variable name is always: org.apache.struts.taglib.html.TOKEN

The value has variable length, but is always a series of alphanumeric

I've been working on this regex using the Jakarta ORO demonstration applet at:

The example text i've been using for the ORO applet is:

<input type="hidden" name="foobar" value="bazbar" />
<input type="hidden" name="org.apache.struts.taglib.html.TOKEN" value="token1"/>
<a href=""
<a href="" />
<a href="" />

Finally, the regular expression is as follows:

I removed the "N" from the token to prevent the regex matching all parameters in
a URL (e. "Gareth" from

The only problem remaining, as you can see if you run the regex and the sample
text in the applet, is that each "half" of the regex (ie the half to check
hidden inputs, and the half to check the URLs) returns two matches, therefore I
can't know which "match no" to specify for the Regular Expression Extractor in

Thanks very much if you're still reading this far, and even bigger thanks if you
can help me out!



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message