I want to use the regex_replace or regexp_extract in hive where i can get only the first n occurrences of special character "^" except the last occurrence and text after last occurrence. f For example:
101^11
should extract101
101^1111^232
should extract101^1111
144^899^890^1
should extract1144^899^890
I have to do with only regex and not with string functions or udf.