diff options
Diffstat (limited to 'doc/it/weechat_plugin_api.it.adoc')
-rw-r--r-- | doc/it/weechat_plugin_api.it.adoc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/doc/it/weechat_plugin_api.it.adoc b/doc/it/weechat_plugin_api.it.adoc index 790e85be7..7482f72d9 100644 --- a/doc/it/weechat_plugin_api.it.adoc +++ b/doc/it/weechat_plugin_api.it.adoc @@ -2159,12 +2159,12 @@ struct t_hashtable *options2 = weechat_hashtable_new (8, NULL, NULL); /* add brackets around URLs */ -weechat_hashtable_set (options2, "regex", "\\w+://\\S+"); +weechat_hashtable_set (options2, "regex", "[a-zA-Z0-9_]+://[^ ]+"); weechat_hashtable_set (options2, "regex_replace", "[ ${re:0} ]"); char *str4 = weechat_string_eval_expression ("test: https://weechat.org", NULL, NULL, NULL); /* "test: [ https://weechat.org ]" */ /* hide passwords */ -weechat_hashtable_set (options2, "regex", "(password=)(\\S+)"); +weechat_hashtable_set (options2, "regex", "(password=)([^ ]+)"); weechat_hashtable_set (options2, "regex_replace", "${re:1}${hide:*,${re:2}}"); char *str5 = weechat_string_eval_expression ("password=abc password=def", NULL, NULL, NULL); /* "password=*** password=***" */ ---- @@ -2187,14 +2187,14 @@ str3 = weechat.string_eval_expression("${buffer.full_name}", {}, {}, {}) # "core # replace with regex: add brackets around URLs options = { - "regex": "\\w+://\\S+", + "regex": "[a-zA-Z0-9_]+://[^ ]+", "regex_replace": "[ ${re:0} ]", } str4 = weechat.string_eval_expression("test: https://weechat.org", {}, {}, options) # "test: [ https://weechat.org ]" # replace with regex: hide passwords options = { - "regex": "(password=)(\\S+)", + "regex": "(password=)([^ ]+)", "regex_replace": "${re:1}${hide:*,${re:2}}", } str5 = weechat.string_eval_expression("password=abc password=def", {}, {}, options) # "password=*** password=***" |