regex - Kusto:提取文本中的唯一词
问题描述
是否可以使用 Kusto 从列中提取唯一单词?
示例文本:示例文本、橙色、粗体文本 仅获取单词:an、示例、文本、橙色、粗体
我正在尝试使用这个正则表达式:
表 | 扩展 ff = extract_all(@'(\w+\b)(?!.*\1\b)', info));
解决方案
你可以试试这个,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” ] |
推荐阅读
- performance - 通过 Powershell 脚本减少内存消耗
- python - 使用 Big Query API 将数据摄取到按时间分区的表中,但出现 SyntaxError: Unexpected end of input
- r - 闪亮的应用程序使用查询字符串中的默认值?
- javascript - 如何在 Sequelize Model 中创建方法?
- c - 如何使用开关来偏移 for 循环的开始?
- web-scraping - 如何在本地更改没有 VPN/代理的 IP 地址?
- node.js - Heroku Redis 使用 nodejs 开发
- concurrency - 与 Ben Ari 的频道就餐哲学家陷入僵局?
- c++ - 如何调用在一个类中创建然后传递给另一个类的 c++ 函数指针?
- javascript - 将 HTML 表单提交到带有 JS 验证的 PHP 文件