I have a column that should contain phone numbers but it contains whatever the user wanted. I need to create an update to remove all the characters after an invalid character.
To do this I am using a regex as PATINDEX('%[^0-9+-/()" "]%', [MobilNr])
and it seemed to work until I had some numbers as +1235, 36446
and to my surprise the result is 0 instead of 6. Also if the number contains .
it returns 0.
Does PATINDEX
ignores dot(".") and comma(",")? Are there other characters that PATINDEX
will ignore?