Reputation: 159
I have the string Created RSA Key 1234 from Intelligent Expense ID 54678||||||"
and I need to extract 54678 in Hive QL. I am using this
select description,regexp_extract(description,'ID\s(\d*)\|') as cctkey from smartmatching limit 10
I tested the regex and it looks fine. But hive does not return any output for me. It is showing NULL. Can somebody help
Upvotes: 0
Views: 1059
Reputation: 11032
You need to escape the \s
, \d
and \|
. It should be
ID\\s(\\d*)\\|
Upvotes: 2