Toad 2026 R2 Replace Macro – \r\n vs. \n

Hi experts~

PowerShell confirms that my TXT file uses \r\n for line breaks, but in Toad 2026 R2, I have to use \n in Replace Macro to find them.

This seems a bit strange, as the Toad 2026 R2 documentation use \r\n and \r\n works fine in Toad version 17.

Could you help me clarify this behavior?

test.txt (44 Bytes)

Using Toad 2026 R2, I just tried to follow your steps but could not find any problem.

This is what I did:

  1. Created the macro

  2. Downloaded your test.txt file and opened it in the editor

  3. Right-clicked in the Editor, chose "Replace Macros", then "CommaSeparatedList" and the editor contents changed to the below:

This looks right to me. Let me know if I am missing something.

John,

I found the cause.

I use this macro to trim spaces, add quotes, and convert multiple lines into a single line for use in a SQL WHERE clause.

In my test, \r\n not found occurred after running the Trim macro with ^\s*(.*?)\s*$. If I remember correctly, this worked in previous versions, but not in Toad 2026 R2.

Changing it to ^[ \t]*(.*?)[ \t]*$ fixed the issue.

Could you confirm if this regex is OK for trimming spaces, or would you recommend another regex?

Hi Sarah,

I am no regex expert and cannot answer your question without just researching it and testing it, which I'm sure you have already done.

-John

John, thank you so much~