Please assist with RegeX Expression

Hello,

Please help me with Regex expression.
I currently have this expression:
System.Text.RegularExpressions.Regex.Replace(variable,“[^0-9]”,“”)

This removes all non-numeric characters from string, however I would need to edit this expression so that it would remove all non-numeric characters but keep commas(“,”) in the string and remove all other non-numeric characters, is this be doable?

Can somebody please assist?

Thanks!!

@kalev.tartu Should work with just [^0-9,] or with [^\d,] or did you try that already?

Kind Regards

try this @kalev.tartu

[^0-9$,]

HI @kalev.tartu

Can you share the sample input and expected output?

Regards
Sudharsan

Thank you! This works :slight_smile:

1 Like

Thank you all for replying! :slight_smile:

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