我正在 hive 中学习regexp_extract函数,假设我有表'A'和列'word'为,AwordHello!world,howareyou?
我只想提取标点符号,以便输出,!,?
我如何尝试使用regexp_extract进行以下操作,但未获得所需的输出,select regexp_extract(word,"[^A-Za-z0-9]*","1") from A;
请指导!
最佳答案
hive> with A as (select explode(array('word','Hello!','world,','how','are','you?')) as word)
> select regexp_extract(word,'\\p{Punct}',0) as Punct
> from A
> ;
OK
punct
!
,
?
关于hadoop - 如何仅使用Hive中的regexp_extract函数提取标点符号,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/45532994/