You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by ZK <st...@gmail.com> on 2012/09/13 11:57:04 UTC

Re: help-Regular expression extractor

Hi,
for the example you gave the RegEx would be:
http://www\.Test\.org/pub/WS/([\d]+)

there are plenty of RegEx tutorials on the net, such as:
http://www.zytrax.com/tech/web/regex.htm
http://www.zytrax.com/tech/web/regex.htm 


ZK



--
View this message in context: http://jmeter.512774.n5.nabble.com/help-Regular-expression-extractor-tp5714744p5714781.html
Sent from the JMeter - User mailing list archive at Nabble.com.

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


Re: help-Regular expression extractor

Posted by sebb <se...@gmail.com>.
On 13 September 2012 12:14, Flavio Cysne <fl...@gmail.com> wrote:
> Sorry, the example I wrote are wrong because I forgot to escape the slash
> character. See below:

Forward slash - / - is not a regex meta-character and so does not need
to be escaped.

> Location:.*\/(\d+)\s*$
> Location:.*\/(\d+)\p{Punct}?
> Location:.*\/pub\/WS\/(\d+)\s*$
> Location:.*\/pub\/WS\/(\d+)\p{Punct}?
>
> 2012/9/13 Flavio Cysne <fl...@gmail.com>
>
>> If these numbers will always be at the end of the Location URL, you could
>> use this: Location:.*/(\d+)\s*$
>>
>> If is not guaranteed that these number will be in the last part of
>> Location URL, try this instead: Location:.*/(\d+)\p{Punct}?
>>
>> Obs.: I'm considering that there will be only one part of the URL
>> containing numbers. If this is not guaranteed, add part of the URL to the
>> expression, like these:
>>
>> Location:.*/pub/WS/(\d+)\s*$
>> or
>> Location:.*/pub/WS/(\d+)\p{Punct}?
>>
>> This site has also a good variety of Regular Expression example with
>> detailed descriptions: http://www.regular-expressions.info/
>>
>> Hope it helps.
>> Flávio Cysne
>>
>>
>> 2012/9/13 ZK <st...@gmail.com>
>>
>>> Hi,
>>> for the example you gave the RegEx would be:
>>> http://www\.Test\.org/pub/WS/([\d]+)
>>>
>>> there are plenty of RegEx tutorials on the net, such as:
>>> http://www.zytrax.com/tech/web/regex.htm
>>> http://www.zytrax.com/tech/web/regex.htm
>>>
>>>
>>> ZK
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://jmeter.512774.n5.nabble.com/help-Regular-expression-extractor-tp5714744p5714781.html
>>> Sent from the JMeter - User mailing list archive at Nabble.com.
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
>>> For additional commands, e-mail: user-help@jmeter.apache.org
>>>
>>>
>>

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


Re: help-Regular expression extractor

Posted by Flavio Cysne <fl...@gmail.com>.
Sorry, the example I wrote are wrong because I forgot to escape the slash
character. See below:

Location:.*\/(\d+)\s*$
Location:.*\/(\d+)\p{Punct}?
Location:.*\/pub\/WS\/(\d+)\s*$
Location:.*\/pub\/WS\/(\d+)\p{Punct}?

2012/9/13 Flavio Cysne <fl...@gmail.com>

> If these numbers will always be at the end of the Location URL, you could
> use this: Location:.*/(\d+)\s*$
>
> If is not guaranteed that these number will be in the last part of
> Location URL, try this instead: Location:.*/(\d+)\p{Punct}?
>
> Obs.: I'm considering that there will be only one part of the URL
> containing numbers. If this is not guaranteed, add part of the URL to the
> expression, like these:
>
> Location:.*/pub/WS/(\d+)\s*$
> or
> Location:.*/pub/WS/(\d+)\p{Punct}?
>
> This site has also a good variety of Regular Expression example with
> detailed descriptions: http://www.regular-expressions.info/
>
> Hope it helps.
> Flávio Cysne
>
>
> 2012/9/13 ZK <st...@gmail.com>
>
>> Hi,
>> for the example you gave the RegEx would be:
>> http://www\.Test\.org/pub/WS/([\d]+)
>>
>> there are plenty of RegEx tutorials on the net, such as:
>> http://www.zytrax.com/tech/web/regex.htm
>> http://www.zytrax.com/tech/web/regex.htm
>>
>>
>> ZK
>>
>>
>>
>> --
>> View this message in context:
>> http://jmeter.512774.n5.nabble.com/help-Regular-expression-extractor-tp5714744p5714781.html
>> Sent from the JMeter - User mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
>> For additional commands, e-mail: user-help@jmeter.apache.org
>>
>>
>

Re: help-Regular expression extractor

Posted by Flavio Cysne <fl...@gmail.com>.
If these numbers will always be at the end of the Location URL, you could
use this: Location:.*/(\d+)\s*$

If is not guaranteed that these number will be in the last part of Location
URL, try this instead: Location:.*/(\d+)\p{Punct}?

Obs.: I'm considering that there will be only one part of the URL
containing numbers. If this is not guaranteed, add part of the URL to the
expression, like these:

Location:.*/pub/WS/(\d+)\s*$
or
Location:.*/pub/WS/(\d+)\p{Punct}?

This site has also a good variety of Regular Expression example with
detailed descriptions: http://www.regular-expressions.info/

Hope it helps.
Flávio Cysne

2012/9/13 ZK <st...@gmail.com>

> Hi,
> for the example you gave the RegEx would be:
> http://www\.Test\.org/pub/WS/([\d]+)
>
> there are plenty of RegEx tutorials on the net, such as:
> http://www.zytrax.com/tech/web/regex.htm
> http://www.zytrax.com/tech/web/regex.htm
>
>
> ZK
>
>
>
> --
> View this message in context:
> http://jmeter.512774.n5.nabble.com/help-Regular-expression-extractor-tp5714744p5714781.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>