Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Global search and replace with regex does not correctly replace #2803

Open
Labels
type: imperfectionPerceived defect in any part of project
@sterretjeToo

Description

Describe the problem

A sketch was delivered with additional line feeds; demo code below

#define hello
#include <SoftwareSerial.h>
#include <FastLED.h>
void setup() {
}
void loop() {
}

E.g. between the two include statements

A search correctly finds them

Image

but a replace does not work correctly / as expected; replacing \n\n with \n results in the below

#define hello\n
#include <SoftwareSerial.h>\n
#include <FastLED.h>\n
void setup() {\n
}\n
void loop() {
}

To reproduce

Create a sketch with some additional empty lines.
Try to replace using a regular expression

Image results in the unexpected behaviour.

Expected behavior

The expected behaviour is that additional empty lines are removed.

Arduino IDE version

2.3.7-nightly-20251025

Operating system

Windows

Operating system version

Win 11

Additional context

Detected while using IDE 2.3.6.
Sketch was not saved.

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest nightly build
  • My report contains all necessary details

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: imperfectionPerceived defect in any part of project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /