mirror of
https://github.com/weechat/weechat.git
synced 2026-07-04 00:33:13 +02:00
core: improve the string_replace_regex function (add reference char, change syntax for match refs)
The reference char is now an argument for the function. The references are now $0 .. $99 and $+ was added (last match, with highest number). The syntax to replace a match with one char is now: $.cN or $.c+ (for example: "$.*3").
This commit is contained in:
@@ -221,7 +221,9 @@ trigger_config_create_option (const char *trigger_name, int index_option,
|
||||
"many regex can be separated by a space, for example: "
|
||||
"\"/regex1/replace1/var1 /regex2/replace2/var2\"; the "
|
||||
"separator \"/\" can be replaced by any char (one or more "
|
||||
"identical chars), except '\\' and parentheses"),
|
||||
"identical chars), except '\\' and parentheses; matching "
|
||||
"groups can be used in replace: $0 to $99, $+ for last "
|
||||
"match and $.cN to replace all chars of group N by char c"),
|
||||
NULL, 0, 0, value, NULL, 0,
|
||||
NULL, NULL, &trigger_config_change_regex, NULL, NULL, NULL);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user