-
-
Notifications
You must be signed in to change notification settings - Fork 335
add tr/// to trigger regex #1510
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
Comments
Hi, |
tr/// would replace the first character in pattern by first character in replacement, second character in pattern by second character in replacement and so on. For example: tr/abc/ABC/ will replace a by A, b by B and c by C. On the other hand, s/abc/ABC/ will replace any occurence of abc by ABC
|
This starts simple but begs a question how many features this should support. For example, GNU |
Also, I forgot to mention but |
y/// could be an "alias" to tr/// so anyone can pick the prefix they're used to |
Hi, I schedule this for v3.8 and I wrote a specification, your feedback is welcome: https://specs.weechat.org/specs/2022-002-trigger-regex-commands.html |
…command to "s" (regex replace) (issue #1510)
Implemented. So be careful with old triggers which could have an incompatible regex format, and would then be ignored on upgrade (they must be fixed before upgrading WeeChat). |
Feature description
Sometimes someone join #weechat and ask if this is possible to mimic tr in a trigger, tr/// instead of s///. It would be nice if we could use a prefix before the delimiter to specify the desired behavior, for example tr/abc/ABC/ and s/hi/hello/ and when there is no prefix, fallback to s///. But I just created a trigger with a letter as delimiter and the trigger is valid so I guess it's not possible this way since a delimiter can be a letter?
The text was updated successfully, but these errors were encountered: