For example,string is abc123CD need to find out a method to read only numbers in the string i.e.
abc123CD
select a_postgres_function(\'a
Try this:
select (regexp_matches('abc123CD', '\d+'))[1];
Since regexp_matches returns array of text, you should access the first element by [1].
regexp_matches
[1]