Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Match and replace

Juan Jul 13, 2017 02:32AM UTC

How do I write a newline character in the Replace field, in "Match and Replace"? Which kind of notation is used? Is there any list of examples?
Thanks in advance.

Paul Johnston Jul 13, 2017 07:22AM UTC Support Center agent

This isn’t directly supported, but there is a workaround.

Create your match and replace rule with an X where you want your newline. Click the cog icon and save the options. Then edit this JSON file and replace X with \r\n When you reload the options you will have a newline in your rule.

Please let us know if you need any further assistance.

Juan Jul 14, 2017 10:04PM UTC
As I am using the free version, the rule is in registry, stored in HKCU\Software\JavaSoft\Prefs\burp\1.5free.proxy.matchreplacerule5 key. I tried what you suggested but it does not work. During execution, the replacement removes the slashes and keeps "rn" as if it were a normal string.
Thank you very much.

Paul Johnston Jul 17, 2017 07:30AM UTC Support Center agent

Hi Juan,

Please follow the instructions I provided. They work fine on Burp Free for me.

Juan Jul 19, 2017 11:44PM UTC
Thank you very much Paul.
I was careful and did what you told me. I have no JSON file, only the key I mentioned, in the registry. And the result is as if the backslashes weren't there (I get the rn substring instead of a newline character). I am trying a replacement in the response body.
Is there any document about the syntax of the "regular expressions" Burp use?

Paul Johnston Jul 20, 2017 09:53AM UTC Support Center agent

Hi Juan,

I’ve attached a couple of screenshots that show you how to save the JSON file.

Burp uses Java regular expressions. This cheat sheet may help you:


Juan Jul 20, 2017 11:51PM UTC
Thank you very much Paul!
I really appreciate your help. I updated to 1.7.23 version and studied the sheet.
With kind regards,

Post Your public answer

Your name
Your email address