How to extract the particular data using Regex

I have to extract no 7,456.90 from the regex given below can any one please help me to solve this.
~Data Valuation 8.5%~7,456.90
The above given is the data to provide regex, we cant specify 8.5%,it may
varies to some other numbers also.
Output should be 7,456.90

Hi,

How about the following

System.Text.RegularExpressions.Regex.Match(yourString,"[\d.,]+$").Value

or

System.Text.RegularExpressions.Regex.Match(yourString,"[\d.,]+(?=\s*)$").Value

Regards,

Hi @Chippy_Kolot

Another Solution

System.Text.RegularExpressions.Regex.Match(inputString,"(?<=~)\S+$").Value

image

Regards
Gokul

Hello @Chippy_Kolot
Try this regex pattern

YourString=Data Valuation 8.5%~7,456.90

System.Text.RegularExpressions.Regex.Match(YourString,"(?<=~)\d.+").ToString.trim

image

image

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.