Forum Discussion
SamiJ21
Feb 20, 2020Copper Contributor
Negative Lookahead with Regular expression in Kusto Log Analytics
Hello everyone, I'm trying to extract exceptions within our logs using regular expression. And it happens that I need to perform a negative lookahead to ignore a specific string. The query looks ...
Noa Kuperberg
Microsoft
Feb 25, 2020Apparently the full explanation is here. Quoting from it:
"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
What you're trying to achieve isn't supported by that library - see 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. Thus, backreferences and look-around assertions are not supported.'"
- frmaxJan 26, 2021Copper Contributor
Noa Kuperberg thanks for the information on the RE2 library. Negative lookahead would be very useful in some cases. 😕 would be great if this could be added somehow. Why not use System.Text.RegularExpressions instead of re2? 😛