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

fix: support captures in ignores #5126

Merged
merged 7 commits into from
Jan 27, 2024

Conversation

Nerixyz
Copy link
Contributor

@Nerixyz Nerixyz commented Jan 24, 2024

Adds back support for using captures in regex ignores.

Since Qt doesn't provide a way of replacing a single match with some replacement while supporting both capturing groups and lookahead/-behind in the regex, I included a custom implementation. It's essentially the implementation of QString::replace(const QRegularExpression &, const QString &). The difference is that here, only the replacement is returned. Essentially the \1, \2 and so on are replaced with the proper capture.

Fixes #5125.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

src/providers/twitch/TwitchMessageBuilder.cpp Show resolved Hide resolved
@pajlada pajlada merged commit 36ef8fb into Chatterino:master Jan 27, 2024
20 checks passed
@Nerixyz Nerixyz deleted the fix/ignores-captures branch January 27, 2024 14:46
devJimmyboy pushed a commit to devJimmyboy/chatterino7 that referenced this pull request Feb 11, 2024
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

Successfully merging this pull request may close these issues.

Capturing groups no longer work in Ignore replacements
3 participants