替换 Kusto 中的 GUID

Pun*_*eet 0 regexp-replace kql azure-data-explorer

如何替换 Kusto 查询中没有值的所有 GUID。

例如

我的数据看起来像

/页/1d58e797-a905-403f-ebd9-27ccf3f1d2cd/用户/4d58e797-a905-403f-ebd9-27ccf3f1d2c3

而且我要

/页面//用户/

小智 8

您可以使用替换功能。另外,您可以在此处测试正则表达式。

let input = '/page/1d58e797-a905-403f-ebd9-27ccf3f1d2cd/user/4d58e797-a905-403f-ebd9-27ccf3f1d2c3';
let rx = '[({]?[a-fA-F0-9]{8}[-]?([a-fA-F0-9]{4}[-]?){3}[a-fA-F0-9]{12}[})]?';
print replace(rx, '', input);
Run Code Online (Sandbox Code Playgroud)