首页 > 解决方案 > Kusto:提取文本中的唯一词

问题描述

是否可以使用 Kusto 从列中提取唯一单词?

示例文本:示例文本、橙色、粗体文本 仅获取单词:an、示例、文本、橙色、粗体

我正在尝试使用这个正则表达式:

表 | 扩展 ff = extract_all(@'(\w+\b)(?!.*\1\b)', info));

标签: regexazureazure-data-explorer

解决方案


你可以试试这个,set_union()在输出之上使用extract_all()

print input = "an example text, an orange, text bold Get only words: an, example, text, orange, bold"
| extend unique_words = set_union(dynamic(null), extract_all(@"(\w+)", input))
输入 独特的单词
示例文本、橙色、粗体文本 仅获取单词:an、示例、文本、橙色、粗体 [
“an”、
“example”、
“text”、
“orange”、
“bold”、
“Get”、
“only”、
“words”
]

推荐阅读