I have a string AF1234 and I want to print 1234 , also sometimes I get only numbers like 25 and 23 and I want these numbers as well, hence I am trying to use a regex_replace to check the string, below is the syntax:
select substring(nvl(nullif(regexp_replace(regexp_replace('AF1234','A$',''),'[[:digit:]]',''),''),'XX'),1,2)
This works in impala but not hive