Regex sed edit formatting
We can already edit text by writing 's/old/new/' (thus replacing the first time "old" was said with "new" in our previous message, but it would be extremely useful if it were possible to do two things.
1. s/foo/bar/g to replace all occurrences of said foo
2. s/regex/regex in order to more accurately capture text.
-
This would be absolutely fantastic. Even without real regex support, just having /g (or maybe even /c, so /gc would work) would be amazing.
4 -
I think having full regex support is a bit of a stretch to implement. And the c option would be more work to implement (adding a confirmation interface to the web, mobile app, and desktop clients, etc.). The only options I see in the sed manual (https://www.gnu.org/software/sed/manual/html_node/The-_0022s_0022-Command.html) that make sense to implement in a cross-platform chat app are `g` and `<number>`. At very least, I'd like to have the trailing g option work -- that seems easy enough to add and would be really nice to have :)
Related aside (bug?): Currently, if you include a trailing slash in your Discord sed expression, it includes that slash in the replacement text. E.g. if your last message was "abcd", sending "s/abc/xyz/" will change your message to "xyz/d".1 -
I don't think that it would be too hard to implement, as it is now it already uses the string.replace function. just needs to take whats between s/ and / then replace it with whats between / and /
1
Iniciar sesión para dejar un comentario.
Comentarios
3 comentarios