1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-09 19:23:13 +02:00

core: add ${re:#} to get the index of last group captured in evaluation of expressions

This commit is contained in:
Sébastien Helleu
2017-03-30 22:13:14 +02:00
parent f0c8da2f05
commit bb00b6b8fb
6 changed files with 62 additions and 12 deletions
+6
View File
@@ -464,6 +464,12 @@ eval_replace_vars_cb (void *data, const char *text)
{
if (strcmp (text + 3, "+") == 0)
number = eval_regex->last_match;
else if (strcmp (text + 3, "#") == 0)
{
snprintf (str_value, sizeof (str_value),
"%d", eval_regex->last_match);
return strdup (str_value);
}
else
{
number = strtol (text + 3, &error, 10);