-
-
Notifications
You must be signed in to change notification settings - Fork 402
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
find: use slash or pipe in sed-like command #1993
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I unlinked #1188 because that requests support for using any character as delimiter; this PR adds only one alternative, and removes the escaping feature.
This might get skipped for 7.1, not sure. I'd like to experiment with lookarounds for handling escapes, and/or libraries like sedparse that could be used after this plugin gets extracted to its own package in the run-up to Sopel 8 (since we're conservative about dependencies primarily so no one has to install the whole universe even if they disable the whole core set).
Works for me, either way I gave it a shot! |
I'll hold on an approving review for now, but everything is addressed. I just have to do that lookaround research/experiment(s) and/or decide if this is worth breaking the escaped-delimiter feature in a point release. |
d41de94
to
40df6fe
Compare
@Exirel Were you thinking of simplifying this to the easier solution of two rules? Though I still want to investigate lookarounds. |
40df6fe
to
e18260f
Compare
@dgw updated, see if you like it better. Escaping is back! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually like this approach a lot. It just looks like there might be a little mistake in one of the rules?
Should be better now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we can see why this was deemed "the fucking regex of death" at one point. Pattern's so long you get lost in it! 😂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, this looks ready to squash out the fixups 🚀
Co-authored-by: dgw <dgw@technobabbl.es>
5c974c7
to
5690063
Compare
Description
Attempted fix for #1188
So it was kind of messy because working with backreference to negate them is (not) surprisingly hard to do. I got some help from StackOverflow but I had to let go of the "you can escape the separator to use it inside the substitution/editing text ".
But heh, on the other hand, as one of the authors of the previous regex, if you want both / and | as separator AND having both in a substitution message:
PS: it was on @dgw 's task list, but I did it anyway out of curiosity for regex backreference.
Checklist
make qa
(runsmake quality
andmake test
)