stefankueng / grepWin

A powerful and fast search tool using regular expressions
https://tools.stefankueng.com/grepWin.html
GNU General Public License v3.0
1.72k stars 179 forks source link

Issue with a search replacement that contains a backslash #467

Closed u01jmg3 closed 5 months ago

u01jmg3 commented 5 months ago

Expected

Search for: namespace App\Models\Assessments;

Replace with/Capture format: namespace App\Models\Assessment;

Actual

namespace AppModelsAssessment;


ℹ️ The same issue does not exist with forward slashes.

stefankueng commented 5 months ago

\ is the escape character (so you can use e.g. \n for a newline). You have to use namespace App\\Models\\Assessment;

u01jmg3 commented 5 months ago

I realise \ is the escape character but is there no way GrepWin can handle this for me? It's also not obvious to the user that manual escaping is required.

e.g. in Notepad++, they have a "search mode" that allows you to toggle on/off whether \ is treated as an escape character.

stefankueng commented 5 months ago

grepWin is a regex tool. So the regex rules apply, which includes escaping.

lifenjoiner commented 5 months ago

Try "Text search" mode using the CI build of the latest commit.

u01jmg3 commented 5 months ago

grepWin is a regex tool. So the regex rules apply, which includes escaping.

Even on a "text search"?


Same outcome using the "text search".

image

lifenjoiner commented 5 months ago

https://github.com/stefankueng/grepWin/actions/runs/8424535527

I had fixed it.

u01jmg3 commented 5 months ago

Thanks @lifenjoiner

I managed to download the artifact build from GitHub Actions and sure enough it works. I guess this was fixed a while ago?

Looking forward to seeing this in an official release