Page 1 of 1

Find and replace with regular expressions

Posted: Thu Oct 16, 2003 10:07 am
by BDifferent
Hi,

I have a data file which contains floating point values with a comma as decimal separator (as it is usual in Germany). I want to replace these commas by the decimal point, but only in the floating point values; commas also appear elsewhere in the file, e.g. separating text. So I did a search with regular expressions; I searched for "[0-9],[0-9]" which works well. But if I want to replace these characters by "[0-9].[0-9]" the regular expressions are also inserted. Just entering the "." as replacement text does not work either (as expected). How can I achieve my goal of replacing only commas surrounded by numbers by a decimal point?

Thanks in advance,
Finn

Posted: Thu Oct 16, 2003 10:47 am
by s_reynisson
Find ([0-9]),([0-9])
Replace \1.\2
Using Posix

Re: Find and replace with regular expression

Posted: Thu Oct 16, 2003 11:01 am
by BDifferent
s_reynisson wrote:Find ([0-9]),([0-9])
Replace \1.\2
Using Posix
That one works, thank you! However, a different solution has just come up: I could just change the system's country settings and create the data file again which then has the "." as decimal separator...

Thanks for your efforts,
Finn