Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with a search replacement that contains a backslash #467

Closed
u01jmg3 opened this issue Mar 30, 2024 · 7 comments
Closed

Issue with a search replacement that contains a backslash #467

u01jmg3 opened this issue Mar 30, 2024 · 7 comments

Comments

@u01jmg3
Copy link

u01jmg3 commented Mar 30, 2024

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
Copy link
Owner

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

@u01jmg3
Copy link
Author

u01jmg3 commented Mar 30, 2024

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
Copy link
Owner

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

@lifenjoiner
Copy link
Collaborator

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

@u01jmg3
Copy link
Author

u01jmg3 commented Mar 30, 2024

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
Copy link
Collaborator

@u01jmg3
Copy link
Author

u01jmg3 commented Mar 30, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants