0

I have to change string like "100,23 zł" and "29,23 $" to:

"100,23" "29,23"

So i want to remove all characters instead of numbers and ','

rafal235
  • 691
  • 2
  • 7
  • 17

3 Answers3

1

I don't know how to do it with your language but it would be simple enough, just match anything that isn't a number or a comma and replace it with an empty string.

So match any non-digit character or a comma with: (\D|,)* or this [^0-9,]*

Replace with empty string: "" or '' depending on your language string delimiters .

Ibrahim Najjar
  • 19,178
  • 4
  • 69
  • 95
0

you can replace this /\s\D+/ with empty string and this will do. This is applicable when you do not have any other content in the file. If you do have other contents too then try this /\d+\s\D+/

dirtydexter
  • 1,063
  • 1
  • 10
  • 17
0

You can use a negated class containing only digits and comma:

[^0-9,]+

See demo on regex101.

Jerry
  • 70,495
  • 13
  • 100
  • 144