Skip to content

Regular expressions Replace and Replace/Find #4181

Open

Description

@almi33

Description
Neither Replace no Replace/Find works for regular expressions. Find still works.

To Reproduce
Just try to Find and then replace some text using regular expression
The important detail is that reqexp shall match the part of line from somewhere in the middle til the end and refer \r as end of line.
For example file containing three lines (last line is empty) and it is CRLF end of line style:
abc, def
ghi, jkl

Use regexp ,.*\r for find and \r for replace.
Yes, using \r seems incorrect, but it is still valid.

Expected behavior
Text is expected to be replaced when regular expression is used

Version Information:
Windows 11
Eclipse IDE for C/C++ Developers (includes Incubating components)
Version: 2026-06 (4.40.0)
Build id: 20260604-0653

Link to original issue
Eclipse CDT issue #1494

Activity

  1. HeikoKlare commented on Jul 12, 2026

    @HeikoKlare
    Contributor

    Line ending on Windows is \r\n, not \r. When using \r\n for find/replace, the string is properly matched. For find/replace, there is also the generic \R for platform-independent line endings.

  2. almi33 commented on Jul 15, 2026

    @almi33
    Author

    Agree. From the other hand regexp ,.*\r is absolutely valid doesn't matter what OS or lets say line ending is in the file. Regexp \r is also absolutely valid one. There is pretty long discussion on this in the original issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions