jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Serpent_Guard <bluegate...@gmail.com>
Subject Re: regular expression extractor
Date Fri, 19 Dec 2008 05:32:43 GMT

I think you want '[\w+] (\d+) .+' (w/o quotes).

[\w+] - \w is a character class that matches any word character
(alphanumeric plus underscores).  '+' changes it from matching a single
character to matching one or more characters.

(\d+) - \d is a character class that matches digits.  '+' makes it match one
or more digits.

.+ - '.' matches any non-newline character.  '+' makes it match one or more
of those characters.

If you specifically don't want to allow digits in the first word, you can
change '[\w+]' to '[\w^\d]'

I'm no expert at regex, but I've been learning a lot about it lately and I'm
reasonably sure this'll do the trick.



PAULO LOURENCO (RE-ESI-Workflow) wrote:
> 
> Greetings,
> 
>  
> 
> I know this is going to look like a basic question, which I apologize
> for in advance, but I'm having problems with a simple regular
> expression.
> 
> Basically I want to extract a number that comes after a word and that is
> followed by a space and something else. Ex:
> 
> Word 123 - more stuff
> 
> From the previous sentence, what I want o extract is the 123, regardless
> of what comes after ('-', '.', etc) knowing that the number comes always
> after a word.
> 
>  
> 
> Thanks in advance!
> 
>  
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/regular-expression-extractor-tp21074258p21086078.html
Sent from the JMeter - User mailing list archive at Nabble.com.


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


Mime
View raw message