summaryrefslogtreecommitdiff
path: root/doc/it
diff options
context:
space:
mode:
Diffstat (limited to 'doc/it')
-rw-r--r--doc/it/autogen/user/trigger_commands.adoc2
-rw-r--r--doc/it/weechat_plugin_api.it.adoc8
-rw-r--r--doc/it/weechat_user.it.adoc6
3 files changed, 8 insertions, 8 deletions
diff --git a/doc/it/autogen/user/trigger_commands.adoc b/doc/it/autogen/user/trigger_commands.adoc
index ee161ede8..a9f3d57cf 100644
--- a/doc/it/autogen/user/trigger_commands.adoc
+++ b/doc/it/autogen/user/trigger_commands.adoc
@@ -75,7 +75,7 @@ When a trigger callback is called, following actions are performed, in this orde
Examples (you can also look at default triggers with /trigger listdefault):
add text attributes *bold*, _underline_ and /italic/ (only in user messages):
- /trigger add effects modifier weechat_print "${tg_tag_nick}" "==\*(\S+)\*==*${color:bold}${re:1}${color:-bold}*== ==_(\S+)_==_${color:underline}${re:1}${color:-underline}_== ==/(\S+)/==/${color:italic}${re:1}${color:-italic}/"
+ /trigger add effects modifier weechat_print "${tg_tag_nick}" "==\*([^ ]+)\*==*${color:bold}${re:1}${color:-bold}*== ==_([^ ]+)_==_${color:underline}${re:1}${color:-underline}_== ==/([^ ]+)/==/${color:italic}${re:1}${color:-italic}/"
hide nicklist bar on small terminals:
/trigger add resize_small signal signal_sigwinch "${info:term_width} < 100" "" "/bar hide nicklist"
/trigger add resize_big signal signal_sigwinch "${info:term_width} >= 100" "" "/bar show nicklist"
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=***"
diff --git a/doc/it/weechat_user.it.adoc b/doc/it/weechat_user.it.adoc
index c02e3d740..70c6748fa 100644
--- a/doc/it/weechat_user.it.adoc
+++ b/doc/it/weechat_user.it.adoc
@@ -4057,7 +4057,7 @@ Matching groups can be used in "replace":
Example: use bold for words between "*":
----
-/\*(\S+)\*/*${color:bold}${re:1}${color:-bold}*/
+/\*([^ ]+)\*/*${color:bold}${re:1}${color:-bold}*/
----
Example: default trigger _server_pass_ uses this regular expression to hide
@@ -4065,7 +4065,7 @@ password in commands `/server` and `/connect` (chars in passwords are replaced
by `+*+`):
----
-==^(/(server|connect) .*-(sasl_)?password=)(\S+)(.*)==${re:1}${hide:*,${re:4}}${re:5}
+==^(/(server|connect) .*-(sasl_)?password=)([^ ]+)(.*)==${re:1}${hide:*,${re:4}}${re:5}
----
[NOTE]
@@ -4339,7 +4339,7 @@ string/string).
Display URLs in green:
----
-/trigger add url_color modifier weechat_print "${tg_notify}" "==\S+://\S+==${color:green}${re:0}${color:reset}=="
+/trigger add url_color modifier weechat_print "${tg_notify}" "==[a-zA-Z0-9_]+://[^ ]+==${color:green}${re:0}${color:reset}=="
----
[NOTE]