summaryrefslogtreecommitdiff
path: root/doc/en/weechat_user.en.asciidoc
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2014-10-26 12:30:13 +0100
committerSébastien Helleu <flashcode@flashtux.org>2014-10-26 12:30:13 +0100
commit3f5a810254db47c0943007ca7ff749f9b78145ee (patch)
treeab0d898adb0e33b9cd8fbc110174250b7b3b06c3 /doc/en/weechat_user.en.asciidoc
parenta012eefb77c246d294b99afcee2ef065258e7e4e (diff)
downloadweechat-3f5a810254db47c0943007ca7ff749f9b78145ee.zip
trigger: evaluate and replace regex groups at same time, new format for regex option in triggers (incompatible with version 1.0) (closes #224)
Diffstat (limited to 'doc/en/weechat_user.en.asciidoc')
-rw-r--r--doc/en/weechat_user.en.asciidoc14
1 files changed, 8 insertions, 6 deletions
diff --git a/doc/en/weechat_user.en.asciidoc b/doc/en/weechat_user.en.asciidoc
index 0e0144392..d21ffa7f8 100644
--- a/doc/en/weechat_user.en.asciidoc
+++ b/doc/en/weechat_user.en.asciidoc
@@ -3062,15 +3062,17 @@ The char "/" can be replaced by any char (one or more identical chars).
Matching groups can be used in "replace":
-* `$0` to `$99`: `$0` is the whole match, `$1` to `$99` are groups captured
-* `$+`: the last match (with highest number)
-* `$.cN`: match "N" with all chars replaced by "c" (example: `$.*2` is the group
- #2 with all chars replaced by `*`).
+* `${re:0}` to `${re:99}`: `${re:0}` is the whole match, `${re:1}` to
+ `${re:99}` are groups captured
+* `${re:+}`: the last match (with highest number)
+* `${hide:c,${re:N}}`: match "N" with all chars replaced by "c"
+ (example: `${hide:*,${re:2}}` is the group #2 with all chars replaced by
+ `*`).
Example: use bold for words between "*":
----
-/\*(\S+)\*/*${color:bold}$1${color:-bold}*/
+/\*(\S+)\*/*${color:bold}${re:1}${color:-bold}*/
----
Example: default trigger 'server_pass' uses this regular expression to hide
@@ -3078,7 +3080,7 @@ password in commands `/server` and `/connect` (chars in passwords are replaced
by `*`):
----
-==^(/(server|connect) .*-(sasl_)?password=)(\S+)(.*)==$1$.*4$5
+==^(/(server|connect) .*-(sasl_)?password=)(\S+)(.*)==${re:1}${hide:*,${re:4}}${re:5}
----
[NOTE]