0

I want to return the non-alpha numeric characters in my character fields in postgresql. Excluding spaces in the result as well. I want to be able to see only all non-alpha numeric characters in my result.

Example:

First Name | Last Name
ABC&DEF    | GHIJ\

Result:

First Name | Last Name
&          | \

How can I do this?

1
  • What did you try before you posted this? Where did you get stuck when you tried to solve it yourself, or read other existing answers? Commented Sep 9, 2014 at 8:34

1 Answer 1

1

try this:

select regexp_replace(first_name,'[A-Za-z]','','g'), regexp_replace(last_name,'[A-Za-z]','','g') from table_name; 
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.