我想在记事本++文件的以下行中将enabled =“ true”替换为enabled =“ false”。我的文件中有大量此类行需要替换。 Pl。帮我一样。 (带有notepad ++的reg exp)
<Action sortkey="002" enabled="true" desc="Macro_APP_Open" profile="Safety_Type_1_MacroAPPOpen">
<Action sortkey="003" enabled="true" desc="Change_From_Portal_To_Project_View" profile="Change_From_Portal_To_Project_View">
<Action sortkey="04" enabled="true" desc="Project_Open_from_OpenPath_SafetyCert_ProjectView" profile="Click_FirstSteps_PortalView">
<Action sortkey="005" enabled="true" desc="Project_SaveAs" profile="EnterProjectDetails_ToSave">
答案 0 :(得分:1)
<Action sortkey="\d+".+?enabled="\Ktrue
false
. matches newline
说明:
<Action sortkey=" : literally
\d+ : 1 or more digits
" : double quote
.+? : 1 or more any character, not greedy
enabled=" : literally
\K : forget all we have seen until this position
true : literally
给定示例的结果
<Action sortkey="002" enabled="false" desc="Macro_APP_Open" profile="Safety_Type_1_MacroAPPOpen">
<Action sortkey="003" enabled="false" desc="Change_From_Portal_To_Project_View" profile="Change_From_Portal_To_Project_View">
<Action sortkey="04" enabled="false" desc="Project_Open_from_OpenPath_SafetyCert_ProjectView" profile="Click_FirstSteps_PortalView">
<Action sortkey="005" enabled="false" desc="Project_SaveAs" profile="EnterProjectDetails_ToSave">