on 09-03-2020 9:30 PM
We have a requirement to remove all the character except (a-z, A-Z, 0-9) so we used regex_replace function.but it is working fine for some cases and in some cases some alternate character got added into end of string.
Syntax that we have used :- regex_replace(input,'\[^a-zA-Z0-9 \]','')
Anyone who faced the similar issue and how you overcome from this.
Many Thanks!
Your regex is fine and I double checked your example on my machine - the output is as expected and remains equal.
Where does the source data come from? Can you check your data input directly on database level / system level or file level to make sure the attribute you are using your regex on actually contains only 'HAMILTON'?
To me this looks like there's some kind of last name or even an address included in the string that you just regexed.
I.e Hamilton, Rytyna RD.
Regards,
Julian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Riegel,
i have done some changes and added one temp table before this regex function to cross check the data and what i can see is data in that table is coming fine but once data processed through this regex function this abnormality happening. now instead of 'HAMILTON' it's coming as 'HAMILTONSQUAREIENGSN'. this is just one example and like this many other data are also affected.
Regards,
Bilok
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.