What do I need to enter in Capture Regex to get a value in the middle of the text?
Get "123456" Value from: Visit 123456 has been created successfully.
or
Get "Test" value from: Visit Test has been created successfully
Get partial Value in the innertext
Re: Get partial Value in the innertext
Hi,
You can use this regex, to extract number from string:
You can use this regex, to extract number from string:
And this one for extracting string after "Visit" (+ space) string:\d+
Hope this helps?(?<=Visit\s)[^\s]+
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
-
- Posts: 9
- Joined: Wed Nov 08, 2017 10:59 pm
Re: Get partial Value in the innertext
The string is in format: AA - BB - CC - DD. I would like to capture the last part of the string, i.e. DD (the DD string contains spaces). Regex capture (?<=\-\s)(?s)(.*$) returns BB - CC - DD. But how to capture the part after the last minus and space?
Re: Get partial Value in the innertext
Hi,
Try this...
Try this...
[^- \s]+$
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: Get partial Value in the innertext
What about this?...
[^-\s][^-]+$
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: Get partial Value in the innertext
That worked, thanks a lot!