You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Bachorík Jaroslav <Ja...@exprit.cz> on 2003/07/08 16:29:16 UTC

Regular expressions again

Hi,

I need to use the Regular Expression Extractor to get some data out from the server response. However, I still have troubles with getting it working properly. The first problem is connected with the "Match No." parameter of RegExtractor - when I set it to 0 or 1 it works just nice. But when I use any other number I get "no match". I'm sure there's more than one occurence of of a string I search for but I can't get to it.
And here goes the second problem - I want to extract all image sources on web page. I use the following pattern to match the "img" tag -> <img.*src="(.*)".*
What I get is either "no match" or a random piece of HTML source code starting on the first image source and continuig randomly ...

Any help would be appreciated

Regards

JBachorik


---
Odchozí zpráva neobsahuje viry.
Zkontrolováno antivirovým systémem AVG (http://www.grisoft.cz).
Verze: 6.0.497 / Virová báze: 296 - datum vydání: 04.07.2003
 

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


RE: Regular expressions again

Posted by vijay <vi...@relq.com>.
hi ,
this site also has some good info on reg exps
http://etext.lib.virginia.edu/helpsheets/regex.html
vka

-----Original Message-----
From: mstover1@apache.org [mailto:mstover1@apache.org]
Sent: Tuesday, July 08, 2003 8:21 PM
To: JMeter Users List
Subject: Re: Regular expressions again


Ending a regex with .* is guaranteed to match the rest of the page.  Try
something like:

<img[^>]*src="([^"]*)"

And buy a book about regular expressions - it's money well spent as regexes
are very complex.

-Mike

On 8 Jul 2003 at 16:29, Bachor¡k Jaroslav wrote:

> Hi,
>
> I need to use the Regular Expression Extractor to get some data out from
the server response. However, I still have troubles with getting it working
properly. The first problem is connected with the "Match No." parameter of
RegExtractor - when I set it to 0 or 1 it works just nice. But when I use
any
other number I get "no match". I'm sure there's more than one occurence of
of
a string I search for but I can't get to it.
> And here goes the second problem - I want to extract all image sources on
web page. I use the following pattern to match the "img" tag ->
<img.*src="(.*)".*
> What I get is either "no match" or a random piece of HTML source code
starting on the first image source and continuig randomly ...
>
> Any help would be appreciated
>
> Regards
>
> JBachorik
>
>
> ---
> Odchoz¡ zpr va neobsahuje viry.
> Zkontrolov no antivirov m syst‚mem AVG (http://www.grisoft.cz).
> Verze: 6.0.497 / Virov  b ze: 296 - datum vyd n¡: 04.07.2003
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>



--
Michael Stover
mstover1@apache.org
Yahoo IM: mstover_ya
ICQ: 152975688
AIM: mstover777

---------------------------------------------------------------------
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


Re: Regular expressions again

Posted by ms...@apache.org.
Ending a regex with .* is guaranteed to match the rest of the page.  Try 
something like:

<img[^>]*src="([^"]*)"

And buy a book about regular expressions - it's money well spent as regexes 
are very complex.

-Mike

On 8 Jul 2003 at 16:29, Bachor¡k Jaroslav wrote:

> Hi,
> 
> I need to use the Regular Expression Extractor to get some data out from 
the server response. However, I still have troubles with getting it working 
properly. The first problem is connected with the "Match No." parameter of 
RegExtractor - when I set it to 0 or 1 it works just nice. But when I use any 
other number I get "no match". I'm sure there's more than one occurence of of 
a string I search for but I can't get to it.
> And here goes the second problem - I want to extract all image sources on 
web page. I use the following pattern to match the "img" tag -> 
<img.*src="(.*)".*
> What I get is either "no match" or a random piece of HTML source code 
starting on the first image source and continuig randomly ...
> 
> Any help would be appreciated
> 
> Regards
> 
> JBachorik
> 
> 
> ---
> Odchoz¡ zpr va neobsahuje viry.
> Zkontrolov no antivirov m syst‚mem AVG (http://www.grisoft.cz).
> Verze: 6.0.497 / Virov  b ze: 296 - datum vyd n¡: 04.07.2003
>  
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> 



--
Michael Stover
mstover1@apache.org
Yahoo IM: mstover_ya
ICQ: 152975688
AIM: mstover777

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org