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

Regex search for newlines #421

Open
oonet opened this issue Sep 23, 2020 · 5 comments
Open

Regex search for newlines #421

oonet opened this issue Sep 23, 2020 · 5 comments

Comments

@oonet
Copy link

oonet commented Sep 23, 2020

Regex doesn't see \n (but does see newline characters pasted into search string).

@tsujan
Copy link
Owner

tsujan commented Sep 23, 2020

Yes, you're right and I'm aware of it. Unfortunately, I found no simple way to connect how Qt processes blocks (=lines) with how regex handles newline. Actually, I devised a method to support newlines in regex search and it worked but it was so complicated that I didn't add it to the code.

I leave this page open. Who knows? Maybe an elegant solution exits or the above-mentioned method can be simplified and added to the code.

@oonet
Copy link
Author

oonet commented Sep 23, 2020

Not ideal, but maybe substitute newline character (as pasted) for all occurrences of \n in search string?

@tsujan
Copy link
Owner

tsujan commented Sep 23, 2020

Regex can include things like (?=\n), (?<!\n) or (\s\n){1,3}. I can just hope that the problem only seems so complex and a simple solution exists somehow...

@oonet
Copy link
Author

oonet commented Sep 23, 2020

I feel for you!

Just testing, it appears FeatherPad finds newline characters only with regex unselected.

Is there a multiline flag that must be set?

@tsujan
Copy link
Owner

tsujan commented Sep 23, 2020

it appears FeatherPad finds newline characters only with regex unselected.

I added my reply to a wrong page ;) See #418 (comment)

@tsujan tsujan changed the title Regex search for newlines Regex search for newlines and replacement with capture groups Aug 19, 2023
@tsujan tsujan changed the title Regex search for newlines and replacement with capture groups Regex search for newlines Aug 25, 2023
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

2 participants