Hi,
I need to get the inner text of an element having numbers and alhpabets as numbers only.
Is there a way to apply regular expression in the Xpath and then return the Innertext only with Numbers?
Return Innertext using Regex
Re: Return Innertext using Regex
Hi,
Sure, there is always a way to achieve what you want. Just please post a Ranorex snapshot (not screenshot) of the problematic element. And don’t forget to specify, what exactly you want to get from given element. Thanks.
Sure, there is always a way to achieve what you want. Just please post a Ranorex snapshot (not screenshot) of the problematic element. And don’t forget to specify, what exactly you want to get from given element. Thanks.
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: Return Innertext using Regex
Hi,
Thank you for the reply. I have attached the ranorex snapshot of the element (which is a TD). Here the innertext of the TD is 28.5067 USD.
I want to add this element to the repository and get the innertext as 28.5067 only by removing the USD.
Thanks in advance
You do not have the required permissions to view the files attached to this post.
Re: Return Innertext using Regex
Hi,
I’m not behind my PC, but give a try regex from this post...
https://www.ranorex.com/forum/issues-wi ... tml#p57377
Just replace GB with USD. Hope this helps?
I’m not behind my PC, but give a try regex from this post...
https://www.ranorex.com/forum/issues-wi ... tml#p57377
Just replace GB with USD. Hope this helps?
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
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Return Innertext using Regex
Here is another option:
https://regex101.com/r/hxZtdj/1
In English, this matches: (Any number of digits).(Any number of digits)
\d = Any single digit
+ = Match 1 or more digits
Cheers,
Ned
Code: Select all
\d+.\d+
In English, this matches: (Any number of digits).(Any number of digits)
\d = Any single digit
+ = Match 1 or more digits
Cheers,
Ned
Re: Return Innertext using Regex
Thank you @Support Team, @Odklizec. It worked