简体   繁体   English

Kusto是否不支持正则表达式环顾?

[英]Does Kusto not support regex lookarounds?

It seems that Kusto doesn't support regex lookarounds, as I get the following errors when I try to run the below commands. 看来Kusto不支持正则表达式,因为当我尝试运行以下命令时收到以下错误。 Am I using the wrong syntax? 我使用的语法错误吗? If this feature really isn't supported, where can I give feedback to vote for this feature? 如果确实不支持此功能,我在哪里可以反馈此功能?


Positive Lookahead Test: 正向超前测试:

print(extract("t(?=t)", 0, "http"))

Expected Output: tt 预期输出: tt

Actual Error: Relop semantic error: 'extract()' has the following semantic error: SEM0420: Regex pattern is ill-formed: t(?=t). 实际错误: Relop semantic error: 'extract()' has the following semantic error: SEM0420: Regex pattern is ill-formed: t(?=t).


Negative Lookahead Test: 负前瞻测试:

print(extract("t(?!t)", 0, "http"))

Expected Output: tp 预期产量: tp

Actual Error: Relop semantic error: 'extract()' has the following semantic error: SEM0420: Regex pattern is ill-formed: t(?!t). 实际错误: Relop semantic error: 'extract()' has the following semantic error: SEM0420: Regex pattern is ill-formed: t(?!t).

Kusto uses the re2 library: https://github.com/google/re2/wiki/Syntax , as mentioned here: https://docs.microsoft.com/en-us/azure/kusto/query/re2 Kusto使用re2库: https : //github.com/google/re2/wiki/Syntax ,如此处所述: https : //docs.microsoft.com/zh-cn/azure/kusto/query/re2

What you're trying to achieve isn't supported by that library - see https://github.com/google/re2/wiki/WhyRE2 : 该库不支持您要实现的目标-请参阅https://github.com/google/re2/wiki/WhyRE2

As a matter of principle, RE2 does not support constructs for which only backtracking solutions are known to exist. 原则上,RE2不支持仅存在回溯解决方案的构造。 Thus, backreferences and look-around assertions are not supported. 因此,不支持反向引用和环顾断言。

As for your other question, feature requests can be submitted/upvoted @ https://aka.ms/adx.uservoice 至于您的其他问题,可以通过@ https://aka.ms/adx.uservoice提交/更新功能请求

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM