Find and Replace every 2nd line in a pair under certain conditions [closed]

Set the search to Regular expression mode:

Notepad++ search box showing this search

Find what: ^(<ApplicationPath>[^<]*?\\West\\[^<]+?</ApplicationPath>\r?\n)<CommandLine />

Replace with: \1<CommandLine>trees -nowindow</CommandLine>


Assuming your are using something like Notepad++, which supports full regex replacements, you may try the following:

Find:    (<ApplicationPath>.*\\West\\.*<\/ApplicationPath>\n)<CommandLine \/>
Replace: $1<CommandLine>trees -nowindow</CommandLine>

Here is a demo.