seayakin
14th July 2011, 01:37 PM
Anyone out there know how to construct regex to find (ideally replace) non-alphanumeric characters in a column?
I've been looking here (http://www.postgresql.org/docs/8.3/static/functions-matching.html) and have been struggling. I never fully understand the syntax for regex so that is probably part of my problem and have only gotten others to work largely by trial and error.
Tried
SELECT * FROM my_schema.my_table WHERE barcode ~* '.*\k.*'
SELECT * FROM my_schema.my_table WHERE barcode ~* '.*\w.*'
I've been looking here (http://www.postgresql.org/docs/8.3/static/functions-matching.html) and have been struggling. I never fully understand the syntax for regex so that is probably part of my problem and have only gotten others to work largely by trial and error.
Tried
SELECT * FROM my_schema.my_table WHERE barcode ~* '.*\k.*'
SELECT * FROM my_schema.my_table WHERE barcode ~* '.*\w.*'