UiPath-仅替换Title值的Regex

pvcm50d1  于 2023-06-25  发布在  其他
关注(0)|答案(1)|浏览(119)

你好,我正试图写一个正则表达式,取代标题的值"下载"与"安装"
输入如下所示

Title="[Installing %=System.LinkedTitle.Installing%]" Value="Installing"
Title="Introduction"
Title="Storing equipment & lubrication"
Title="Installing the collector laterals" 
Title="Installing the mechanical scraper" 
Title="Installing the saturator system"
Title="Installing the sludge beach" 
Title="Installing the effluent weir"
Title="[Installing%=System.LinkedTitle%]"

输出应该如下所示:

Title="[Installing %=System.LinkedTitle.Installing%]" Value="Installing"
Title="Introduction"
Title="Storing equipment & lubrication"
Title="Downloading the collector laterals" 
Title="Downloading the mechanical scraper" 
Title="Downloading the saturator system"
Title="Downloading the sludge beach" 
Title="Downloading the effluent weir"
Title="[Installing%=System.LinkedTitle%]"

(?<!\[)Installing(?![^[\]]*%])
这个正则表达式突出显示了title和value的安装,我只想突出显示title值。

cwtwac6a

cwtwac6a1#

我想你的意思是用下载代替安装。
您可以使用另一个负向后查找排除Value=

(?<!\[)(?<!\bValue=")Installing(?![^[\]]*%])

Regex demo
或者如果支持,在lookbehind中使用交替:

(?<!\[|\bValue=")Installing(?![^[\]]*%])

Regex demo
但是如果你只想要Installing紧跟在Title="之后,那么

(?<=\bTitle=")Installing\b

相关问题