Can anyone help me make regular expression to solve this issue

Dear All I have values from excel sheet to be read and inserted to an application
the values I have are
AED‏1,579.00
$210,890.00
EGP‏1,579.00

I need to make regular expression to convert all the above to be
‏1,579.00
210,890.00
1,579.00

1 Like

sure
if the input is stored in a variable before taking it to a application named str_input then
use this expression
system.Text.RegularExpressions.Regex.Replace(str_input,"(\d).*","")

Cheers @Dina.abdelhakam

Dear thanks for your help
but this returned the AED and EGP not the number

1 Like

fine
try with this pls type mistake instead of Match typed as Replace
system.Text.RegularExpressions.Regex.Match(str_input,"(\d).*").ToString

it worked buddy @Dina.abdelhakam
image

Cheers @Dina.abdelhakam

kindly let know for any queries or clarification
Cheers @Dina.abdelhakam

1 Like

Hi @Dina.abdelhakam
Use System.text.regularexpression.regex.match("InputString","\d+").Tostring and store this in String variable.

Dear Could you please tell me how to remove the qomma --> “,”

1 Like

but the output mentioned has comma
fine
to remove that as well same expression but with a replace at last
system.Text.RegularExpressions.Regex.Match(str_input,"(\d).*").ToString.Replace(",","")

Cheers @Dina.abdelhakam

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