got a column with phone numbers and used the following
KeepChar(Replace(Phone, 'O', '0'), '0123456789') AS %KEY_Phone_Bill
to remove special characters
But I would also like to clean the country code, which is part of some but not all entries. This looks like this:
0049170123456
49170123456
490170123456
0170123456
170123456
The only correct way I would like to keep is 0170123456
So I thought I check if the number begins with 00 oder 490 and replace them with 0. Could I use the replace() with $ or something that indicated I want only replace at the beginning of the string. Or do I need to use regex?
2nd step I would check if any string does not start with a 0, so place a 0 in front of the string.