You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Ed Young <ej...@SummitBid.com> on 2006/12/07 19:12:44 UTC
response assertion xml tag regex
I am trying to match a set of xml tags in a response but having no
luck. Heres what Im trying:
<AssetList\b[^>]*>(.*?)</AssetList>
and I've tried
<AssetList>*</AssetList>
I got this from the regex examples site:
http://www.regular-expressions.org/examples.html
The xml section always looks like this:
<AssetList>lots of stuff between</AssetList>
So I just want to match the tags.
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
Re: response assertion xml tag regex
Posted by sebb <se...@gmail.com>.
On 07/12/06, Ed <ed...@gmail.com> wrote:
> Thanks,
>
> (?s)<AssetList\b[^>]*>(.*?)</AssetList>
>
> Worked.
Thanks for confirming that.
>
> I'm trying to validate a response by adding patterns to test. This
> particular one will validate that I got a particular tag pair on
> different lines. ( with tags between them. )
>
> Wow. I need to do alot of studying to figure out how this works!!
>
There's some documentation on the JMeter Wiki.
If you find any more articles etc you find useful, feel free to add it
to the Wiki.
S.
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
Re: response assertion xml tag regex
Posted by Ed <ed...@gmail.com>.
Thanks,
(?s)<AssetList\b[^>]*>(.*?)</AssetList>
Worked.
I'm trying to validate a response by adding patterns to test. This
particular one will validate that I got a particular tag pair on
different lines. ( with tags between them. )
Wow. I need to do alot of studying to figure out how this works!!
Thanks again.
On 12/7/06, sebb <se...@gmail.com> wrote:
> In 07/12/06, Ed Young <ej...@summitbid.com> wrote:
> > I am trying to match a set of xml tags in a response but having no
> > luck. Heres what Im trying:
> >
> > <AssetList\b[^>]*>(.*?)</AssetList>
>
> I would have thought that should work so long as the closing tag is on
> the same line.
>
> What do you get for $1$ - i.e. group 1?
> It should be the content between the tags.
>
> If the tags can be on different lines, then try
>
> (?s)<AssetList\b[^>]*>(.*?)</AssetList>
>
> This allows . to match newlines
>
> >
> > and I've tried
> >
> > <AssetList>*</AssetList>
>
> That won't work - the * applies to the preceeding > and means zero or more >.
>
> >
> > I got this from the regex examples site:
> > http://www.regular-expressions.org/examples.html
> >
> > The xml section always looks like this:
> > <AssetList>lots of stuff between</AssetList>
> >
> > So I just want to match the tags.
>
> What do you mean by that? Do you want to match specific tags? Just
> start tags, or end tags? Or tag pairs? What part of the text do you
> want to extract?
>
> Or are you trying to validate the response?
>
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>
--
Ed
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
Re: response assertion xml tag regex
Posted by sebb <se...@gmail.com>.
In 07/12/06, Ed Young <ej...@summitbid.com> wrote:
> I am trying to match a set of xml tags in a response but having no
> luck. Heres what Im trying:
>
> <AssetList\b[^>]*>(.*?)</AssetList>
I would have thought that should work so long as the closing tag is on
the same line.
What do you get for $1$ - i.e. group 1?
It should be the content between the tags.
If the tags can be on different lines, then try
(?s)<AssetList\b[^>]*>(.*?)</AssetList>
This allows . to match newlines
>
> and I've tried
>
> <AssetList>*</AssetList>
That won't work - the * applies to the preceeding > and means zero or more >.
>
> I got this from the regex examples site:
> http://www.regular-expressions.org/examples.html
>
> The xml section always looks like this:
> <AssetList>lots of stuff between</AssetList>
>
> So I just want to match the tags.
What do you mean by that? Do you want to match specific tags? Just
start tags, or end tags? Or tag pairs? What part of the text do you
want to extract?
Or are you trying to validate the response?
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org