atom / find-and-replace

Find and replace in a single buffer and in the project
MIT License
242 stars 198 forks source link

Regex Search and Replace Issue #605

Open husni opened 9 years ago

husni commented 9 years ago

Bug found when using regex on Atom:

Input string (in the Editor)

test123

Search & Replace using regex Find: (.*) Replace: $1x

Result:

test123xx

Expected:

test123x

I am using Atom 1.2.4 on Mac OS X 10.11.1

Moved issue from original Atom repo: https://github.com/atom/atom/issues/9807

DaveEveritt commented 8 years ago

This might be related to a similar error for which I ended up using TextMate. Given:

LASTNAME
Firstname

I used:

Find: ([A-Z])\n
Replace: $1-

Result:

LASTNAME-

Firstname

Expected:

LASTNAME-Firstname
lee-dohm commented 8 years ago

Reproduced using Atom v1.6.0-dev-0893201 on Mac OS X 10.11.2

Repro steps:

  1. Launch Atom
  2. Open a new file
  3. Type test123 followed by Enter
  4. Press Cmd+F to show find-and-replace panel
  5. Ensure Regular Expressions is enabled
  6. Enter (.*) in Find input
  7. Enter $1x in Replace input
  8. Click Find button
  9. Click Replace button

Expected: Text should be test123x Actual: Text is test123xx