Get partial Value in the innertext

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
mariya.syera
Posts: 9
Joined: Wed Nov 08, 2017 10:59 pm

Get partial Value in the innertext

Post by mariya.syera » Thu Mar 08, 2018 1:25 am

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

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3930
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Get partial Value in the innertext

Post by odklizec » Thu Mar 08, 2018 8:59 am

Hi,

You can use this regex, to extract number from string:
\d+
And this one for extracting string after "Visit" (+ space) string:
(?<=Visit\s)[^\s]+
Hope this helps? ;)
Pavel Kudrys
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

mariya.syera
Posts: 9
Joined: Wed Nov 08, 2017 10:59 pm

Re: Get partial Value in the innertext

Post by mariya.syera » Thu Mar 08, 2018 4:40 pm

Thank you!
Mariya Syera
Office Ally, Inc