#23275
Yutaka Emura
Keymaster

Hello,

I would like to clarify your question in order to help you.
Is the “Cat1…” line always immediately above the “Dog1…” line?
If so, set the Use Regualr Expression option, and replace

(Cat.*?Cat2.*?)\n(Dog1.*?Dog2.*?)\n

with

\2\1\n

If not, please figure out the maximum number of lines that exist between the “Cat1…” line and the “Dog1…” line. If it is 10 lines, you can replace:

(Cat.*?Cat2.*?)\n{1,10}(Dog1.*?Dog2.*?)\n

with

\2\1\n

and also go to the Advanced button in the Replace dialog box, and enter “10” to the “Additional Lines to Search for Regular Expressions” text box.

I hope this helps.