mirror of
https://github.com/weechat/weechat.git
synced 2026-07-04 00:33:13 +02:00
doc/api: merge examples and results in same column (function string_eval_expression)
This commit is contained in:
+331
-250
@@ -2385,159 +2385,185 @@ str5 = weechat.string_eval_expression("password=abc password=def", {}, {}, optio
|
||||
List of logical operators that can be used in conditions (by order of priority,
|
||||
from first used to last):
|
||||
|
||||
[width="100%",cols="2,1,8,4,4",options="header"]
|
||||
[width="100%",cols="2,1,5,5",options="header"]
|
||||
|===
|
||||
| Operator | Min WeeChat | Description | Examples | Results
|
||||
| Operator | Min WeeChat | Description | Examples
|
||||
|
||||
| `+&&+` | |
|
||||
Logical "and" |
|
||||
`+25 && 77+` +
|
||||
`+25 && 0+` |
|
||||
`+1+` +
|
||||
`+0+`
|
||||
>> `+25 && 77+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+25 && 0+` +
|
||||
== `+0+`
|
||||
|
||||
| `+\|\|+` | |
|
||||
Logical "or" |
|
||||
`+25 \|\| 0+` +
|
||||
`+0 \|\| 0+` |
|
||||
`+1+` +
|
||||
`+0+`
|
||||
>> `+25 \|\| 0+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+0 \|\| 0+` +
|
||||
== `+0+`
|
||||
|===
|
||||
|
||||
List of comparison operators that can be used in conditions (by order of priority,
|
||||
from first used to last):
|
||||
|
||||
[width="100%",cols="2,1,8,4,4",options="header"]
|
||||
[width="100%",cols="2,1,5,5",options="header"]
|
||||
|===
|
||||
| Operator | Min WeeChat | Description | Examples | Results
|
||||
| Operator | Min WeeChat | Description | Examples
|
||||
|
||||
| `+=~+` | |
|
||||
Is matching POSIX extended regex (optional flags are allowed, see function <<_string_regcomp,string_regcomp>>) |
|
||||
`+abc def =~ ab.*ef+` +
|
||||
`+abc def =~ y.*z+` |
|
||||
`+1+` +
|
||||
`+0+`
|
||||
>> `+abc def =~ ab.*ef+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+abc def =~ y.*z+` +
|
||||
== `+0+`
|
||||
|
||||
| `+!~+` | |
|
||||
Is NOT matching POSIX extended regex (optional flags are allowed, see function <<_string_regcomp,string_regcomp>>) |
|
||||
`+abc def !~ ab.*ef+` +
|
||||
`+abc def !~ y.*z+` |
|
||||
`+0+` +
|
||||
`+1+`
|
||||
>> `+abc def !~ ab.*ef+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+abc def !~ y.*z+` +
|
||||
== `+1+`
|
||||
|
||||
| `+==*+` | 2.9 |
|
||||
Is matching mask where "*" is allowed, case sensitive (see function <<_string_match,string_match>>) |
|
||||
`+abc def ==* a*f+` +
|
||||
`+abc def ==* y*z+` |
|
||||
`+1+` +
|
||||
`+0+`
|
||||
>> `+abc def ==* a*f+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+abc def ==* y*z+` +
|
||||
== `+0+`
|
||||
|
||||
| `+!!*+` | 2.9 |
|
||||
Is NOT wildcard mask where "*" is allowed, case sensitive (see function <<_string_match,string_match>>) |
|
||||
`+abc def !!* a*f+` +
|
||||
`+abc def !!* y*z+` |
|
||||
`+0+` +
|
||||
`+1+`
|
||||
>> `+abc def !!* a*f+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+abc def !!* y*z+` +
|
||||
== `+1+`
|
||||
|
||||
| `+=*+` | 1.8 |
|
||||
Is matching mask where "*" is allowed, case insensitive (see function <<_string_match,string_match>>) |
|
||||
`+abc def =* A*F+` +
|
||||
`+abc def =* Y*Z+` |
|
||||
`+1+` +
|
||||
`+0+`
|
||||
>> `+abc def =* A*F+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+abc def =* Y*Z+` +
|
||||
== `+0+`
|
||||
|
||||
| `+!*+` | 1.8 |
|
||||
Is NOT wildcard mask where "*" is allowed, case insensitive (see function <<_string_match,string_match>>) |
|
||||
`+abc def !* A*F+` +
|
||||
`+abc def !* Y*Z+` |
|
||||
`+0+` +
|
||||
`+1+`
|
||||
>> `+abc def !* A*F+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+abc def !* Y*Z+` +
|
||||
== `+1+`
|
||||
|
||||
| `+==-+` | 2.9 |
|
||||
Is included, case sensitive |
|
||||
`+abc def ==- bc+` +
|
||||
`+abc def ==- xyz+` |
|
||||
`+1+` +
|
||||
`+0+`
|
||||
>> `+abc def ==- bc+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+abc def ==- xyz+` +
|
||||
== `+0+`
|
||||
|
||||
| `+!!-+` | 2.9 |
|
||||
Is NOT included, case sensitive |
|
||||
`+abc def !!- bc+` +
|
||||
`+abc def !!- xyz+` |
|
||||
`+0+` +
|
||||
`+1+`
|
||||
>> `+abc def !!- bc+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+abc def !!- xyz+` +
|
||||
== `+1+`
|
||||
|
||||
| `+=-+` | 2.9 |
|
||||
Is included, case insensitive |
|
||||
`+abc def =- BC+` +
|
||||
`+abc def =- XYZ+` |
|
||||
`+1+` +
|
||||
`+0+`
|
||||
>> `+abc def =- BC+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+abc def =- XYZ+` +
|
||||
== `+0+`
|
||||
|
||||
| `+!-+` | 2.9 |
|
||||
Is NOT included, case insensitive |
|
||||
`+abc def !- BC+` +
|
||||
`+abc def !- XYZ+` |
|
||||
`+0+` +
|
||||
`+1+`
|
||||
>> `+abc def !- BC+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+abc def !- XYZ+` +
|
||||
== `+1+`
|
||||
|
||||
| `+==+` | |
|
||||
Equal |
|
||||
`+test == test+` +
|
||||
`+test == string+` |
|
||||
`+1+` +
|
||||
`+0+`
|
||||
>> `+test == test+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+test == string+` +
|
||||
== `+0+`
|
||||
|
||||
| `+!=+` | |
|
||||
Not equal |
|
||||
`+test != test+` +
|
||||
`+test != string+` |
|
||||
`+0+` +
|
||||
`+1+`
|
||||
>> `+test != test+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+test != string+` +
|
||||
== `+1+`
|
||||
|
||||
| `+<=+` | |
|
||||
Less or equal |
|
||||
`+abc <= defghi+` +
|
||||
`+abc <= abc+` +
|
||||
`+defghi <= abc+` +
|
||||
`+15 <= 2+` |
|
||||
`+1+` +
|
||||
`+1+` +
|
||||
`+0+` +
|
||||
`+0+`
|
||||
>> `+abc <= defghi+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+abc <= abc+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+defghi <= abc+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+15 <= 2+` +
|
||||
== `+0+`
|
||||
|
||||
| `+<+` | |
|
||||
Less |
|
||||
`+abc < defghi+` +
|
||||
`+abc < abc+` +
|
||||
`+defghi < abc+` +
|
||||
`+15 < 2+` |
|
||||
`+1+` +
|
||||
`+0+` +
|
||||
`+0+` +
|
||||
`+0+`
|
||||
>> `+abc < defghi+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+abc < abc+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+defghi < abc+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+15 < 2+` +
|
||||
== `+0+`
|
||||
|
||||
| `+>=+` | |
|
||||
Greater or equal |
|
||||
`+defghi >= abc+` +
|
||||
`+abc >= abc+` +
|
||||
`+abc >= defghi+` +
|
||||
`+15 >= 2+` |
|
||||
`+1+` +
|
||||
`+1+` +
|
||||
`+0+` +
|
||||
`+1+`
|
||||
>> `+defghi >= abc+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+abc >= abc+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+abc >= defghi+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+15 >= 2+` +
|
||||
== `+1+`
|
||||
|
||||
| `+>+` | |
|
||||
Greater |
|
||||
`+defghi > abc+` +
|
||||
`+abc > abc+` +
|
||||
`+abc > defghi+` +
|
||||
`+15 > 2+` |
|
||||
`+1+` +
|
||||
`+0+` +
|
||||
`+0+` +
|
||||
`+1+`
|
||||
>> `+defghi > abc+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+abc > abc+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+abc > defghi+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+15 > 2+` +
|
||||
== `+1+`
|
||||
|===
|
||||
|
||||
The comparison is made using floating point numbers if the two expressions are
|
||||
@@ -2559,116 +2585,134 @@ for example:
|
||||
List of variables expanded in expression (by order of priority, from first
|
||||
expanded to last):
|
||||
|
||||
[width="100%",cols="2,1,8,4,4",options="header"]
|
||||
[width="100%",cols="2,1,5,5",options="header"]
|
||||
|===
|
||||
| Format | Min WeeChat | Description | Examples | Results
|
||||
| Format | Min WeeChat | Description | Examples
|
||||
|
||||
| `+${raw:xxx}+` | 3.1 |
|
||||
Raw string (not evaluated). |
|
||||
`+${raw:${info:version}}+` |
|
||||
`+${info:version}+`
|
||||
>> `+${raw:${info:version}}+` +
|
||||
== `+${info:version}+`
|
||||
|
||||
| `+${name}+` | 3.4 |
|
||||
User variable (defined with `+${define:name,value}+`). |
|
||||
`+${name}+` |
|
||||
`+value+`
|
||||
>> `+${name}+` +
|
||||
== `+value+`
|
||||
|
||||
| `+${name}+` | |
|
||||
Variable `name` from hashtable _extra_vars_. |
|
||||
`+${name}+` |
|
||||
`+value+`
|
||||
>> `+${name}+` +
|
||||
== `+value+`
|
||||
|
||||
| `+${weechat_xxx_dir}+` | 3.2 |
|
||||
A WeeChat directory: `+${weechat_config_dir}+`, `+${weechat_data_dir}+`,
|
||||
`+${weechat_cache_dir}+` or `+${weechat_runtime_dir}+`. |
|
||||
`+${weechat_config_dir}+` +
|
||||
`+${weechat_data_dir}+` +
|
||||
`+${weechat_cache_dir}+` +
|
||||
`+${weechat_runtime_dir}+` |
|
||||
`+/home/user/.config/weechat+` +
|
||||
`+/home/user/.local/share/weechat+` +
|
||||
`+/home/user/.cache/weechat+` +
|
||||
`+/run/user/1000/weechat+`
|
||||
>> `+${weechat_config_dir}+` +
|
||||
== `+/home/user/.config/weechat+` +
|
||||
+
|
||||
>> `+${weechat_data_dir}+` +
|
||||
== `+/home/user/.local/share/weechat+` +
|
||||
+
|
||||
>> `+${weechat_cache_dir}+` +
|
||||
== `+/home/user/.cache/weechat+` +
|
||||
+
|
||||
>> `+${weechat_runtime_dir}+` +
|
||||
== `+/run/user/1000/weechat+`
|
||||
|
||||
| `+${eval:xxx}+` | 1.3 |
|
||||
String to evaluate. |
|
||||
`+${eval:${date:${weechat.look.buffer_time_format}}}+` |
|
||||
`+19:02:45+` (with colors if there are color codes in the option
|
||||
weechat.look.buffer_time_format)
|
||||
>> `+${eval:${date:${weechat.look.buffer_time_format}}}+` +
|
||||
== `+19:02:45+` ^(1)^ +
|
||||
+
|
||||
^(1)^ With colors if there are color codes in the option
|
||||
weechat.look.buffer_time_format
|
||||
|
||||
| `+${eval_cond:xxx}+` | 3.1 |
|
||||
String to evaluate as condition. |
|
||||
`+${eval_cond:${window.win_width} > 100}+` |
|
||||
`+1+`
|
||||
>> `+${eval_cond:${window.win_width} > 100}+` +
|
||||
== `+1+`
|
||||
|
||||
| `+${esc:xxx}+` +
|
||||
`+${\xxx}+` | 1.0 |
|
||||
String with escaped chars. |
|
||||
`+${esc:prefix\tmessage}+` +
|
||||
`+${\ua9}+` |
|
||||
`+prefix<TAB>message+` +
|
||||
`+©+`
|
||||
>> `+${esc:prefix\tmessage}+` +
|
||||
== `+prefix<TAB>message+` +
|
||||
+
|
||||
>> `+${\ua9}+` +
|
||||
== `+©+`
|
||||
|
||||
| `+${hide:x,string}+` | 1.1 |
|
||||
String with hidden chars (all chars in `string` replaced by `x`). |
|
||||
`+${hide:*,password}+` |
|
||||
`+********+`
|
||||
>> `+${hide:*,password}+` +
|
||||
>> `+********+`
|
||||
|
||||
| `+${cut:max,suffix,string}+` +
|
||||
`+${cut:+max,suffix,string}+` | 1.8 |
|
||||
String with `max` chars, and optional `suffix` if string is cut. +
|
||||
With the format `+max`, the suffix is counted in max length. |
|
||||
`+${cut:4,…,this is a test}+` +
|
||||
`+${cut:+4,…,this is a test}+` +
|
||||
`+${cut:2,>>,こんにちは世界}+` |
|
||||
`+this…+` +
|
||||
`+t…+` +
|
||||
`+こん>>+`
|
||||
>> `+${cut:4,…,this is a test}+` +
|
||||
== `+this…+` +
|
||||
+
|
||||
>> `+${cut:+4,…,this is a test}+` +
|
||||
== `+t…+` +
|
||||
+
|
||||
>> `+${cut:2,>>,こんにちは世界}+` +
|
||||
== `+こん>>+`
|
||||
|
||||
| `+${cutscr:max,suffix,string}+` +
|
||||
`+${cutscr:+max,suffix,string}+` | 1.8 |
|
||||
String with `max` chars displayed on screen, and optional `suffix` if string is cut. +
|
||||
With the format `+max`, the suffix is counted in max length. |
|
||||
`+${cutscr:4,…,this is a test}+` +
|
||||
`+${cutscr:+4,…,this is a test}+` +
|
||||
`+${cutscr:2,>>,こんにちは世界}+` |
|
||||
`+this…+` +
|
||||
`+thi…+` +
|
||||
`+こ>>+`
|
||||
>> `+${cutscr:4,…,this is a test}+` +
|
||||
== `+this…+` +
|
||||
+
|
||||
>> `+${cutscr:+4,…,this is a test}+` +
|
||||
== `+thi…+` +
|
||||
+
|
||||
>> `+${cutscr:2,>>,こんにちは世界}+` +
|
||||
== `+こ>>+`
|
||||
|
||||
| `+${rev:xxx}+` | 2.2 |
|
||||
Reversed string (color codes are reversed, so the string should not contain
|
||||
color codes). |
|
||||
`+${rev:Hello, world!}+` +
|
||||
`+${rev:Hello, ${color:red}world!}+` |
|
||||
`+!dlrow ,olleH+` +
|
||||
`+!dlrow30F ,olleH+` (no color, the color code is reversed)
|
||||
>> `+${rev:Hello, world!}+` +
|
||||
== `+!dlrow ,olleH+` +
|
||||
+
|
||||
>> `+${rev:Hello, ${color:red}world!}+` +
|
||||
== `+!dlrow30F ,olleH+` ^(1)^ +
|
||||
+
|
||||
^(1)^ No color, the color code is reversed
|
||||
|
||||
| `+${revscr:xxx}+` | 2.7 |
|
||||
Reversed string for screen, color codes are not reversed. |
|
||||
`+${revscr:Hello, world!}+` +
|
||||
`+${revscr:Hello, ${color:red}world!}+` |
|
||||
`+!dlrow ,olleH+` +
|
||||
`+!dlrow ,olleH+` (`pass:[ ,olleH]` in red)
|
||||
>> `+${revscr:Hello, world!}+` +
|
||||
== `+!dlrow ,olleH+` +
|
||||
+
|
||||
>> `+${revscr:Hello, ${color:red}world!}+` +
|
||||
== `+!dlrow ,olleH+` ^(1)^ +
|
||||
+
|
||||
^(1)^ `pass:[ ,olleH]` in red
|
||||
|
||||
| `+${repeat:count,string}+` | 2.3 |
|
||||
Repeated string. |
|
||||
`+${repeat:5,-}+` |
|
||||
`+-----+`
|
||||
>> `+${repeat:5,-}+` +
|
||||
== `+-----+`
|
||||
|
||||
| `+${length:xxx}+` | 2.7 |
|
||||
Length of string (number of UTF-8 chars), color codes are ignored. |
|
||||
`+${length:test}+` +
|
||||
`+${length:こんにちは世界}+` |
|
||||
`+4+` +
|
||||
`+7+`
|
||||
>> `+${length:test}+` +
|
||||
== `+4+` +
|
||||
+
|
||||
>> `+${length:こんにちは世界}+` +
|
||||
== `+7+`
|
||||
|
||||
| `+${lengthscr:xxx}+` | 2.7 |
|
||||
Length of string displayed on screen, color codes are ignored. |
|
||||
`+${lengthscr:test}+` +
|
||||
`+${lengthscr:こんにちは世界}+` |
|
||||
`+4+` +
|
||||
`+14+`
|
||||
>> `+${lengthscr:test}+` +
|
||||
== `+4+` +
|
||||
+
|
||||
>> `+${lengthscr:こんにちは世界}+` +
|
||||
== `+14+`
|
||||
|
||||
| `+${split:number,seps,flags,xxx}+` | 3.3 |
|
||||
Split string, and return, according to `number`: +
|
||||
@@ -2684,24 +2728,32 @@ expanded to last):
|
||||
- `keep_eol`: keep end of line for each value +
|
||||
- `strip_items=xyz`: strip chars `x`, `y` and `z` from beginning/end of items +
|
||||
- `max_items=N`: return max N items |
|
||||
`+${split:1,,,abc,def,ghi}+` +
|
||||
`+${split:-1,,,abc,def,ghi}+` +
|
||||
`+${split:count,,,abc,def,ghi}+` +
|
||||
`+${split:random,,,abc,def,ghi}+` +
|
||||
`+${split:3,,collapse_seps,abc,,,def,,,ghi}+` +
|
||||
`+${split:3,,strip_items=-_,_-abc-_,_-def-_,_-ghi-_}+` +
|
||||
`+${split:2, ,,this is a test}+` +
|
||||
`+${split:2, ,strip_left+strip_right, this is a test }+` +
|
||||
`+${split:2, ,keep_eol,this is a test}+` |
|
||||
`+abc+` +
|
||||
`+ghi+` +
|
||||
`+3+` +
|
||||
`+def+` +
|
||||
`+ghi+` +
|
||||
`+ghi+` +
|
||||
`+is+` +
|
||||
`+is+` +
|
||||
`+is a test+`
|
||||
>> `+${split:1,,,abc,def,ghi}+` +
|
||||
== `+abc+` +
|
||||
+
|
||||
>> `+${split:-1,,,abc,def,ghi}+` +
|
||||
== `+ghi+` +
|
||||
+
|
||||
>> `+${split:count,,,abc,def,ghi}+` +
|
||||
== `+3+` +
|
||||
+
|
||||
>> `+${split:random,,,abc,def,ghi}+` +
|
||||
== `+def+` +
|
||||
+
|
||||
>> `+${split:3,,collapse_seps,abc,,,def,,,ghi}+` +
|
||||
== `+ghi+` +
|
||||
+
|
||||
>> `+${split:3,,strip_items=-_,_-abc-_,_-def-_,_-ghi-_}+` +
|
||||
== `+ghi+` +
|
||||
+
|
||||
>> `+${split:2, ,,this is a test}+` +
|
||||
== `+is+` +
|
||||
+
|
||||
>> `+${split:2, ,strip_left+strip_right, this is a test }+` +
|
||||
== `+is+` +
|
||||
+
|
||||
>> `+${split:2, ,keep_eol,this is a test}+` +
|
||||
== `+is a test+`
|
||||
|
||||
| `+${split_shell:number,xxx}+` | 3.3 |
|
||||
Split shell arguments, and return, according to `number`: +
|
||||
@@ -2709,14 +2761,17 @@ expanded to last):
|
||||
- `random`: a random argument +
|
||||
- integer ≥ 1: the argument by index (1 = first argument) +
|
||||
- integer ≤ -1: the argument by index from the end (-1 = last argument, -2 = penultimate argument, etc.) |
|
||||
`+${split_shell:1,"first arg" arg2}+` +
|
||||
`+${split_shell:-1,"first arg" arg2}+` +
|
||||
`+${split_shell:count,"first arg" arg2}+` +
|
||||
`+${split_shell:random,"first arg" arg2}+` |
|
||||
`+first arg+` +
|
||||
`+arg2+` +
|
||||
`+2+` +
|
||||
`+arg2+`
|
||||
>> `+${split_shell:1,"first arg" arg2}+` +
|
||||
== `+first arg+` +
|
||||
+
|
||||
>> `+${split_shell:-1,"first arg" arg2}+` +
|
||||
== `+arg2+` +
|
||||
+
|
||||
>> `+${split_shell:count,"first arg" arg2}+` +
|
||||
== `+2+` +
|
||||
+
|
||||
>> `+${split_shell:random,"first arg" arg2}+` +
|
||||
== `+arg2+`
|
||||
|
||||
| `+${re:xxx}+` | 1.1 |
|
||||
Regex data: +
|
||||
@@ -2725,75 +2780,91 @@ expanded to last):
|
||||
`+++` = last group captured, +
|
||||
`#` = index of last group captured _(WeeChat ≥ 1.8)_, +
|
||||
`repl_index` = index of replacement being done (starts to 1) _(WeeChat ≥ 3.3)_. |
|
||||
`+${re:0}+` +
|
||||
`+${re:1}+` +
|
||||
`+${re:2}+` +
|
||||
`+${re:+}+` +
|
||||
`+${re:#}+` +
|
||||
`+${re:repl_index}+` |
|
||||
`+test1 test2+` +
|
||||
`+test1+` +
|
||||
`+test2+` +
|
||||
`+test2+` +
|
||||
`+2+` +
|
||||
`+1+`
|
||||
>> `+${re:0}+` +
|
||||
== `+test1 test2+` +
|
||||
+
|
||||
>> `+${re:1}+` +
|
||||
== `+test1+` +
|
||||
+
|
||||
>> `+${re:2}+` +
|
||||
== `+test2+` +
|
||||
+
|
||||
>> `+${re:+}+` +
|
||||
== `+test2+` +
|
||||
+
|
||||
>> `+${re:#}+` +
|
||||
== `+2+` +
|
||||
+
|
||||
>> `+${re:repl_index}+` +
|
||||
== `+1+`
|
||||
|
||||
| `+${color:name}+` | 0.4.2 |
|
||||
WeeChat color code (the name of color has optional attributes),
|
||||
see function <<_color,color>> for supported formats. |
|
||||
`+${color:red}red text+` +
|
||||
`+${color:*214}bold orange text+` |
|
||||
`+red text+` (in red) +
|
||||
`+bold orange text+` (in bold orange)
|
||||
>> `+${color:red}red text+` +
|
||||
== `+red text+` ^(1)^ +
|
||||
+
|
||||
>> `+${color:*214}bold orange text+` +
|
||||
== `+bold orange text+` ^(2)^ +
|
||||
+
|
||||
^(1)^ In red +
|
||||
^(2)^ In bold orange
|
||||
|
||||
| `+${modifier:name,data,string}+` | 2.7 |
|
||||
Result of a modifier, see function
|
||||
<<_hook_modifier_exec,hook_modifier_exec>>. |
|
||||
`+${modifier:eval_path_home,,~}+` +
|
||||
`+${modifier:eval_path_home,directory=config,%h/weechat.conf}+` |
|
||||
`+/home/user+` +
|
||||
`+/home/user/.config/weechat/weechat.conf+`
|
||||
>> `+${modifier:eval_path_home,,~}+` +
|
||||
== `+/home/user+` +
|
||||
+
|
||||
>> `+${modifier:eval_path_home,directory=config,%h/irc.conf}+` +
|
||||
== `+/home/user/.config/weechat/irc.conf+`
|
||||
|
||||
| `+${info:name}+` +
|
||||
`+${info:name,arguments}+` | 0.4.3 |
|
||||
Info from WeeChat or a plugin, see function
|
||||
<<_info_get,info_get>>. |
|
||||
`+${info:version}+` +
|
||||
`+${info:nick_color_name,foo}+` |
|
||||
`+1.0+` +
|
||||
`+lightblue+`
|
||||
>> `+${info:version}+` +
|
||||
== `+1.0+` +
|
||||
+
|
||||
>> `+${info:nick_color_name,foo}+` +
|
||||
== `+lightblue+`
|
||||
|
||||
| `+${base_encode:base,xxx}+` | 2.9 |
|
||||
String encoded in base 16, 32 or 64. |
|
||||
`+${base_encode:16,test string}+` +
|
||||
`+${base_encode:32,test string}+` +
|
||||
`+${base_encode:64,test string}+` |
|
||||
`+7465737420737472696E67+` +
|
||||
`+ORSXG5BAON2HE2LOM4======+` +
|
||||
`+dGVzdCBzdHJpbmc=+`
|
||||
>> `+${base_encode:16,test string}+` +
|
||||
== `+7465737420737472696E67+` +
|
||||
+
|
||||
>> `+${base_encode:32,test string}+` +
|
||||
== `+ORSXG5BAON2HE2LOM4======+` +
|
||||
+
|
||||
>> `+${base_encode:64,test string}+` +
|
||||
== `+dGVzdCBzdHJpbmc=+`
|
||||
|
||||
| `+${base_decode:base,xxx}+` | 2.9 |
|
||||
String decoded from base 16, 32 or 64. |
|
||||
`+${base_decode:16,7465737420737472696E67}+` +
|
||||
`+${base_decode:32,ORSXG5BAON2HE2LOM4======}+` +
|
||||
`+${base_decode:64,dGVzdCBzdHJpbmc=}+` |
|
||||
`+test string+` +
|
||||
`+test string+` +
|
||||
`+test string+`
|
||||
>> `+${base_decode:16,7465737420737472696E67}+` +
|
||||
== `+test string+` +
|
||||
+
|
||||
>> `+${base_decode:32,ORSXG5BAON2HE2LOM4======}+` +
|
||||
== `+test string+` +
|
||||
+
|
||||
>> `+${base_decode:64,dGVzdCBzdHJpbmc=}+` +
|
||||
== `+test string+`
|
||||
|
||||
| `+${date}+` +
|
||||
`+${date:xxx}+` | 1.3 |
|
||||
Current date/time, with custom format (see `man strftime`),
|
||||
default format is `%F %T`. |
|
||||
`+${date}+` +
|
||||
`+${date:%H:%M:%S}+` |
|
||||
`+2015-06-30 19:02:45+` +
|
||||
`+19:02:45+`
|
||||
>> `+${date}+` +
|
||||
== `+2015-06-30 19:02:45+` +
|
||||
+
|
||||
>> `+${date:%H:%M:%S}+` +
|
||||
== `+19:02:45+`
|
||||
|
||||
| `+${env:NAME}+` | 1.2 |
|
||||
Value of the environment variable `NAME`. |
|
||||
`+${env:HOME}+` |
|
||||
`+/home/user+`
|
||||
>> `+${env:HOME}+` +
|
||||
== `+/home/user+`
|
||||
|
||||
| `+${if:condition}+` +
|
||||
`+${if:condition?true}+`
|
||||
@@ -2801,8 +2872,8 @@ expanded to last):
|
||||
Ternary operator with a condition, a value if the condition is true (optional)
|
||||
and another value if the condition is false (optional). If values are not
|
||||
given, "1" or "0" are returned, according to the result of the condition. |
|
||||
`+${if:${info:term_width}>80?big:small}+` |
|
||||
`+big+`
|
||||
>> `+${if:${info:term_width}>80?big:small}+` +
|
||||
== `+big+`
|
||||
|
||||
| `+${calc:xxx}+` | 2.7 |
|
||||
Result of expression, where parentheses and the following operators are
|
||||
@@ -2814,65 +2885,75 @@ expanded to last):
|
||||
`+//+`: result of division without fractional part +
|
||||
`+%+`: remainder of division +
|
||||
`+**+`: power. |
|
||||
`+${calc:5+2*3}+` +
|
||||
`+${calc:(5+2)*3}+` +
|
||||
`+${calc:10/4}+` +
|
||||
`+${calc:10//4}+` +
|
||||
`+${calc:9.2%3}+` +
|
||||
`+${calc:2**16}+` |
|
||||
`+11+` +
|
||||
`+21+` +
|
||||
`+2.5+` +
|
||||
`+2+` +
|
||||
`+0.2+` +
|
||||
`+65536+`
|
||||
>> `+${calc:5+2*3}+` +
|
||||
== `+11+` +
|
||||
+
|
||||
>> `+${calc:(5+2)*3}+` +
|
||||
== `+21+` +
|
||||
+
|
||||
>> `+${calc:10/4}+` +
|
||||
== `+2.5+` +
|
||||
+
|
||||
>> `+${calc:10//4}+` +
|
||||
== `+2+` +
|
||||
+
|
||||
>> `+${calc:9.2%3}+` +
|
||||
== `+0.2+` +
|
||||
+
|
||||
>> `+${calc:2**16}+` +
|
||||
== `+65536+`
|
||||
|
||||
| `+${random:min,max}+` | 3.3 |
|
||||
Random integer number in the range from `min` to `max` (inclusive). |
|
||||
`+${random:0,10}+` |
|
||||
`+3+`
|
||||
>> `+${random:0,10}+` +
|
||||
== `+3+`
|
||||
|
||||
| `+${translate:xxx}+` | 3.2 |
|
||||
Translated string (depends on the language used by WeeChat to display messages). |
|
||||
`+${translate:Plugin}+` |
|
||||
`+Extension+` (example in French)
|
||||
>> `+${translate:Plugin}+` +
|
||||
== `+Extension+` ^(1)^ +
|
||||
+
|
||||
^(1)^ Example in French
|
||||
|
||||
| `+${define:name,value}+` | 3.4 |
|
||||
Define a variable `name` set to `value`, which can then be used in the same
|
||||
evaluated expression with `+${name}+`. |
|
||||
`+${define:len,${calc:5+3}}${len}x${len}+` |
|
||||
`+8x8+`
|
||||
>> `+${define:len,${calc:5+3}}${len}x${len}+` +
|
||||
== `+8x8+`
|
||||
|
||||
| `+${sec.data.name}+` | |
|
||||
Value of the secured data `name`. |
|
||||
`+${sec.data.libera_pass}+` |
|
||||
`+my_password+`
|
||||
>> `+${sec.data.libera_pass}+` +
|
||||
== `+my_password+`
|
||||
|
||||
| `+${file.section.option}+` | |
|
||||
Value of the option. |
|
||||
`+${weechat.look.buffer_time_format}+` |
|
||||
`+%H:%M:%S+`
|
||||
>> `+${weechat.look.buffer_time_format}+` +
|
||||
== `+%H:%M:%S+`
|
||||
|
||||
| `+${name}+` | |
|
||||
Value of local variable `name` in buffer. |
|
||||
`+${nick}+` |
|
||||
`+FlashCode+`
|
||||
>> `+${nick}+` +
|
||||
== `+FlashCode+`
|
||||
|
||||
| `+${pointer}+` | |
|
||||
Variable `pointer` from hashtable _pointers_. |
|
||||
`+${buffer}+` |
|
||||
`+0x1234abcd+`
|
||||
>> `+${buffer}+` +
|
||||
== `+0x1234abcd+`
|
||||
|
||||
| `+${hdata.var1.var2...}+` +
|
||||
`+${hdata[list].var1.var2...}+` | |
|
||||
Hdata value (pointers `window` and `buffer` are set by default with current
|
||||
window/buffer), `list` can be a list name (example: "gui_buffers"), a pointer
|
||||
(example: "0x1234abcd") or a pointer name (example: "my_pointer"). |
|
||||
`+${buffer[gui_buffers].full_name}+` +
|
||||
`+${buffer[my_buffer_pointer].full_name}+` +
|
||||
`+${window.buffer.number}+` |
|
||||
`+core.weechat+` +
|
||||
`+1+`
|
||||
>> `+${buffer[gui_buffers].full_name}+` +
|
||||
== `+core.weechat+` +
|
||||
+
|
||||
>> `+${buffer[my_buffer_pointer].full_name}+` +
|
||||
== `+core.weechat+` +
|
||||
+
|
||||
>> `+${window.buffer.number}+` +
|
||||
== `+1+`
|
||||
|===
|
||||
|
||||
==== string_dyn_alloc
|
||||
|
||||
+331
-250
@@ -2429,159 +2429,185 @@ str5 = weechat.string_eval_expression("password=abc password=def", {}, {}, optio
|
||||
Liste des opérateurs logiques qui peuvent être utilisés dans les conditions
|
||||
(par ordre de priorité, du premier utilisé au dernier) :
|
||||
|
||||
[width="100%",cols="2,1,8,4,4",options="header"]
|
||||
[width="100%",cols="2,1,5,5",options="header"]
|
||||
|===
|
||||
| Opérateur | WeeChat mini | Description | Exemples | Résultats
|
||||
| Opérateur | WeeChat mini | Description | Exemples
|
||||
|
||||
| `+&&+` | |
|
||||
"Et" logique |
|
||||
`+25 && 77+` +
|
||||
`+25 && 0+` |
|
||||
`+1+` +
|
||||
`+0+`
|
||||
>> `+25 && 77+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+25 && 0+` +
|
||||
== `+0+`
|
||||
|
||||
| `+\|\|+` | |
|
||||
"Ou" logique |
|
||||
`+25 \|\| 0+` +
|
||||
`+0 \|\| 0+` |
|
||||
`+1+` +
|
||||
`+0+`
|
||||
>> `+25 \|\| 0+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+0 \|\| 0+` +
|
||||
== `+0+`
|
||||
|===
|
||||
|
||||
Liste des opérateurs de comparaison qui peuvent être utilisés dans les conditions
|
||||
(par ordre de priorité, du premier utilisé au dernier) :
|
||||
|
||||
[width="100%",cols="2,1,8,4,4",options="header"]
|
||||
[width="100%",cols="2,1,5,5",options="header"]
|
||||
|===
|
||||
| Opérateur | WeeChat mini | Description | Exemples | Résultats
|
||||
| Opérateur | WeeChat mini | Description | Exemples
|
||||
|
||||
| `+=~+` | |
|
||||
Correspond à l'expression régulière POSIX étendue (des "flags" facultatifs sont autorisés, voir la fonction <<_string_regcomp,string_regcomp>>) |
|
||||
`+abc def =~ ab.*ef+` +
|
||||
`+abc def =~ y.*z+` |
|
||||
`+1+` +
|
||||
`+0+`
|
||||
>> `+abc def =~ ab.*ef+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+abc def =~ y.*z+` +
|
||||
== `+0+`
|
||||
|
||||
| `+!~+` | |
|
||||
Ne correspond PAS à l'expression régulière POSIX étendue (des "flags" facultatifs sont autorisés, voir la fonction <<_string_regcomp,string_regcomp>>) |
|
||||
`+abc def !~ ab.*ef+` +
|
||||
`+abc def !~ y.*z+` |
|
||||
`+0+` +
|
||||
`+1+`
|
||||
>> `+abc def !~ ab.*ef+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+abc def !~ y.*z+` +
|
||||
== `+1+`
|
||||
|
||||
| `+==*+` | 2.9 |
|
||||
Correspond au masque où le caractère joker "*" est autorisé, sensible à la casse (voir la fonction <<_string_match,string_match>>) |
|
||||
`+abc def ==* a*f+` +
|
||||
`+abc def ==* y*z+` |
|
||||
`+1+` +
|
||||
`+0+`
|
||||
>> `+abc def ==* a*f+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+abc def ==* y*z+` +
|
||||
== `+0+`
|
||||
|
||||
| `+!!*+` | 2.9 |
|
||||
Ne correspond PAS au masque où le caractère joker "*" est autorisé, sensible à la casse (voir la fonction <<_string_match,string_match>>) |
|
||||
`+abc def !!* a*f+` +
|
||||
`+abc def !!* y*z+` |
|
||||
`+0+` +
|
||||
`+1+`
|
||||
>> `+abc def !!* a*f+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+abc def !!* y*z+` +
|
||||
== `+1+`
|
||||
|
||||
| `+=*+` | 1.8 |
|
||||
Correspond au masque où le caractère joker "*" est autorisé, insensible à la casse (voir la fonction <<_string_match,string_match>>) |
|
||||
`+abc def =* A*F+` +
|
||||
`+abc def =* Y*Z+` |
|
||||
`+1+` +
|
||||
`+0+`
|
||||
>> `+abc def =* A*F+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+abc def =* Y*Z+` +
|
||||
== `+0+`
|
||||
|
||||
| `+!*+` | 1.8 |
|
||||
Ne correspond PAS au masque où le caractère joker "*" est autorisé, insensible à la casse (voir la fonction <<_string_match,string_match>>) |
|
||||
`+abc def !* A*F+` +
|
||||
`+abc def !* Y*Z+` |
|
||||
`+0+` +
|
||||
`+1+`
|
||||
>> `+abc def !* A*F+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+abc def !* Y*Z+` +
|
||||
== `+1+`
|
||||
|
||||
| `+==-+` | 2.9 |
|
||||
Est inclus, sensible à la casse |
|
||||
`+abc def ==- bc+` +
|
||||
`+abc def ==- xyz+` |
|
||||
`+1+` +
|
||||
`+0+`
|
||||
>> `+abc def ==- bc+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+abc def ==- xyz+` +
|
||||
== `+0+`
|
||||
|
||||
| `+!!-+` | 2.9 |
|
||||
N'est PAS inclus, sensible à la casse |
|
||||
`+abc def !!- bc+` +
|
||||
`+abc def !!- xyz+` |
|
||||
`+0+` +
|
||||
`+1+`
|
||||
>> `+abc def !!- bc+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+abc def !!- xyz+` +
|
||||
== `+1+`
|
||||
|
||||
| `+=-+` | 2.9 |
|
||||
Est inclus, insensible à la casse |
|
||||
`+abc def =- BC+` +
|
||||
`+abc def =- XYZ+` |
|
||||
`+1+` +
|
||||
`+0+`
|
||||
>> `+abc def =- BC+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+abc def =- XYZ+` +
|
||||
== `+0+`
|
||||
|
||||
| `+!-+` | 2.9 |
|
||||
N'est PAS inclus, insensible à la casse |
|
||||
`+abc def !- BC+` +
|
||||
`+abc def !- XYZ+` |
|
||||
`+0+` +
|
||||
`+1+`
|
||||
>> `+abc def !- BC+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+abc def !- XYZ+` +
|
||||
== `+1+`
|
||||
|
||||
| `+==+` | |
|
||||
Égal |
|
||||
`+test == test+` +
|
||||
`+test == string+` |
|
||||
`+1+` +
|
||||
`+0+`
|
||||
>> `+test == test+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+test == string+` +
|
||||
== `+0+`
|
||||
|
||||
| `+!=+` | |
|
||||
Non égal |
|
||||
`+test != test+` +
|
||||
`+test != string+` |
|
||||
`+0+` +
|
||||
`+1+`
|
||||
>> `+test != test+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+test != string+` +
|
||||
== `+1+`
|
||||
|
||||
| `+<=+` | |
|
||||
Plus petit ou égal |
|
||||
`+abc <= defghi+` +
|
||||
`+abc <= abc+` +
|
||||
`+defghi <= abc+` +
|
||||
`+15 <= 2+` |
|
||||
`+1+` +
|
||||
`+1+` +
|
||||
`+0+` +
|
||||
`+0+`
|
||||
>> `+abc <= defghi+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+abc <= abc+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+defghi <= abc+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+15 <= 2+` +
|
||||
== `+0+`
|
||||
|
||||
| `+<+` | |
|
||||
Plus petit |
|
||||
`+abc < defghi+` +
|
||||
`+abc < abc+` +
|
||||
`+defghi < abc+` +
|
||||
`+15 < 2+` |
|
||||
`+1+` +
|
||||
`+0+` +
|
||||
`+0+` +
|
||||
`+0+`
|
||||
>> `+abc < defghi+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+abc < abc+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+defghi < abc+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+15 < 2+` +
|
||||
== `+0+`
|
||||
|
||||
| `+>=+` | |
|
||||
Plus grand ou égal |
|
||||
`+defghi >= abc+` +
|
||||
`+abc >= abc+` +
|
||||
`+abc >= defghi+` +
|
||||
`+15 >= 2+` |
|
||||
`+1+` +
|
||||
`+1+` +
|
||||
`+0+` +
|
||||
`+1+`
|
||||
>> `+defghi >= abc+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+abc >= abc+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+abc >= defghi+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+15 >= 2+` +
|
||||
== `+1+`
|
||||
|
||||
| `+>+` | |
|
||||
Plus grand |
|
||||
`+defghi > abc+` +
|
||||
`+abc > abc+` +
|
||||
`+abc > defghi+` +
|
||||
`+15 > 2+` |
|
||||
`+1+` +
|
||||
`+0+` +
|
||||
`+0+` +
|
||||
`+1+`
|
||||
>> `+defghi > abc+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+abc > abc+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+abc > defghi+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+15 > 2+` +
|
||||
== `+1+`
|
||||
|===
|
||||
|
||||
La comparaison est faite en utilisant des nombres à virgule si les deux expressions
|
||||
@@ -2603,118 +2629,136 @@ de chaque expression, par exemple :
|
||||
Liste des variables étendues dans l'expression (par ordre de priorité, de la
|
||||
première étendue à la dernière) :
|
||||
|
||||
[width="100%",cols="2,1,8,4,4",options="header"]
|
||||
[width="100%",cols="2,1,5,5",options="header"]
|
||||
|===
|
||||
| Format | WeeChat mini | Description | Exemples | Résultats
|
||||
| Format | WeeChat mini | Description | Exemples
|
||||
|
||||
| `+${raw:xxx}+` | 3.1 |
|
||||
Chaîne brute (non évaluée). |
|
||||
`+${raw:${info:version}}+` |
|
||||
`+${info:version}+`
|
||||
>> `+${raw:${info:version}}+` +
|
||||
== `+${info:version}+`
|
||||
|
||||
| `+${nom}+` | 3.4 |
|
||||
Variable définie par l'utilisateur (avec `+${define:nom,valeur}+`). |
|
||||
`+${nom}+` |
|
||||
`+valeur+`
|
||||
>> `+${nom}+` +
|
||||
== `+valeur+`
|
||||
|
||||
| `+${nom}+` | |
|
||||
Variable `nom` de la table de hachage _extra_vars_. |
|
||||
`+${nom}+` |
|
||||
`+valeur+`
|
||||
>> `+${nom}+` +
|
||||
== `+valeur+`
|
||||
|
||||
| `+${weechat_xxx_dir}+` | 3.2 |
|
||||
Un répertoire WeeChat : `+${weechat_config_dir}+`, `+${weechat_data_dir}+`,
|
||||
`+${weechat_cache_dir}+` ou `+${weechat_runtime_dir}+`. |
|
||||
`+${weechat_config_dir}+` +
|
||||
`+${weechat_data_dir}+` +
|
||||
`+${weechat_cache_dir}+` +
|
||||
`+${weechat_runtime_dir}+` |
|
||||
`+/home/user/.config/weechat+` +
|
||||
`+/home/user/.local/share/weechat+` +
|
||||
`+/home/user/.cache/weechat+` +
|
||||
`+/run/user/1000/weechat+`
|
||||
>> `+${weechat_config_dir}+` +
|
||||
== `+/home/user/.config/weechat+` +
|
||||
+
|
||||
>> `+${weechat_data_dir}+` +
|
||||
== `+/home/user/.local/share/weechat+` +
|
||||
+
|
||||
>> `+${weechat_cache_dir}+` +
|
||||
== `+/home/user/.cache/weechat+` +
|
||||
+
|
||||
>> `+${weechat_runtime_dir}+` +
|
||||
== `+/run/user/1000/weechat+`
|
||||
|
||||
| `+${eval:xxx}+` | 1.3 |
|
||||
Chaîne à évaluer. |
|
||||
`+${eval:${date:${weechat.look.buffer_time_format}}}+` |
|
||||
`+19:02:45+` (avec des couleurs s'il y a des codes couleur dans l'option
|
||||
weechat.look.buffer_time_format)
|
||||
>> `+${eval:${date:${weechat.look.buffer_time_format}}}+` +
|
||||
== `+19:02:45+` ^(1)^ +
|
||||
+
|
||||
^(1)^ Avec des couleurs s'il y a des codes couleur dans l'option
|
||||
weechat.look.buffer_time_format
|
||||
|
||||
| `+${eval_cond:xxx}+` | 3.1 |
|
||||
Chaîne à évaluer comme condition. |
|
||||
`+${eval_cond:${window.win_width} > 100}+` |
|
||||
`+1+`
|
||||
>> `+${eval_cond:${window.win_width} > 100}+` +
|
||||
== `+1+`
|
||||
|
||||
| `+${esc:xxx}+` +
|
||||
`+${\xxx}+` | 1.0 |
|
||||
Chaîne avec caractères échappés. |
|
||||
`+${esc:préfixe\tmessage}+` +
|
||||
`+${\ua9}+` |
|
||||
`+préfixe<TAB>message+` +
|
||||
`+©+`
|
||||
>> `+${esc:préfixe\tmessage}+` +
|
||||
== `+préfixe<TAB>message+` +
|
||||
+
|
||||
>> `+${\ua9}+` +
|
||||
== `+©+`
|
||||
|
||||
| `+${hide:x,chaîne}+` | 1.1 |
|
||||
Chaîne avec les caractères masqués (tous les caractères dans `chaîne`
|
||||
remplacés par `x`). |
|
||||
`+${hide:*,mot_de_passe}+` |
|
||||
`+************+`
|
||||
>> `+${hide:*,mot_de_passe}+` +
|
||||
== `+************+`
|
||||
|
||||
| `+${cut:max,suffixe,chaîne}+` +
|
||||
`+${cut:+max,suffixe,chaîne}+` | 1.8 |
|
||||
Chaîne avec `max` caractères, et un `suffixe` facultatif si la chaîne est coupée. +
|
||||
Avec le format `+max`, le suffixe est compté dans la longueur maximale. |
|
||||
`+${cut:4,…,ceci est un test}+` +
|
||||
`+${cut:+4,…,ceci est un test}+` +
|
||||
`+${cut:2,>>,こんにちは世界}+` |
|
||||
`+ceci…+` +
|
||||
`+c…+` +
|
||||
`+こん>>+`
|
||||
>> `+${cut:4,…,ceci est un test}+` +
|
||||
== `+ceci…+` +
|
||||
+
|
||||
>> `+${cut:+4,…,ceci est un test}+` +
|
||||
== `+c…+` +
|
||||
+
|
||||
>> `+${cut:2,>>,こんにちは世界}+` +
|
||||
== `+こん>>+`
|
||||
|
||||
| `+${cutscr:max,suffixe,chaîne}+` +
|
||||
`+${cutscr:+max,suffixe,chaîne}+` | 1.8 |
|
||||
Chaîne avec `max` caractères affichés à l'écran, et un `suffixe` facultatif si la chaîne est coupée. +
|
||||
Avec le format `+max`, le suffixe est compté dans la longueur maximale. |
|
||||
`+${cutscr:4,…,ceci est un test}+` +
|
||||
`+${cutscr:+4,…,ceci est un test}+` +
|
||||
`+${cutscr:2,>>,こんにちは世界}+` |
|
||||
`+ceci…+` +
|
||||
`+cec…+` +
|
||||
`+こ>>+`
|
||||
>> `+${cutscr:4,…,ceci est un test}+` +
|
||||
== `+ceci…+` +
|
||||
+
|
||||
>> `+${cutscr:+4,…,ceci est un test}+` +
|
||||
== `+cec…+` +
|
||||
+
|
||||
>> `+${cutscr:2,>>,こんにちは世界}+` +
|
||||
== `+こ>>+`
|
||||
|
||||
| `+${rev:xxx}+` | 2.2 |
|
||||
Chaîne inversée (les codes couleurs sont inversés, donc la chaîne ne devrait
|
||||
pas contenir de codes couleurs). |
|
||||
`+${rev:Bonjour, le monde !}+` +
|
||||
`+${rev:Bonjour, ${color:red}le monde !}+` |
|
||||
`+! ednom el ,ruojnoB+` +
|
||||
`+! ednom el30F ,ruojnoB+` (pas de couleur, le code couleur est inversé)
|
||||
>> `+${rev:Bonjour, le monde !}+` +
|
||||
== `+! ednom el ,ruojnoB+` +
|
||||
+
|
||||
>> `+${rev:Bonjour, ${color:red}le monde !}+` +
|
||||
== `+! ednom el30F ,ruojnoB+` ^(1)^ +
|
||||
+
|
||||
^(1)^ Pas de couleur, le code couleur est inversé
|
||||
|
||||
| `+${revscr:xxx}+` | 2.7 |
|
||||
Chaîne inversée pour l'écran : les codes couleurs ne sont pas inversés. |
|
||||
`+${revscr:Bonjour, le monde !}+` +
|
||||
`+${revscr:Bonjour, ${color:red}le monde !}+` |
|
||||
`+! ednom el ,ruojnoB+` +
|
||||
`+! ednom el ,ruojnoB+` (`pass:[ ,ruojnoB]` en rouge)
|
||||
>> `+${revscr:Bonjour, le monde !}+` +
|
||||
== `+! ednom el ,ruojnoB+` +
|
||||
+
|
||||
>> `+${revscr:Bonjour, ${color:red}le monde !}+` +
|
||||
== `+! ednom el ,ruojnoB+` ^(1)^ +
|
||||
+
|
||||
^(1)^ (`pass:[ ,ruojnoB]` en rouge
|
||||
|
||||
| `+${repeat:nombre,chaîne}+` | 2.3 |
|
||||
Chaîne répétée. |
|
||||
`+${repeat:5,-}+` |
|
||||
`+-----+`
|
||||
>> `+${repeat:5,-}+` +
|
||||
== `+-----+`
|
||||
|
||||
| `+${length:xxx}+` | 2.7 |
|
||||
Longueur de la chaîne (nombre de caractères UTF-8), les codes couleurs sont
|
||||
ignorés. |
|
||||
`+${length:test}+` +
|
||||
`+${length:こんにちは世界}+` |
|
||||
`+4+` +
|
||||
`+7+`
|
||||
>> `+${length:test}+` +
|
||||
== `+4+` +
|
||||
+
|
||||
>> `+${length:こんにちは世界}+` +
|
||||
== `+7+`
|
||||
|
||||
| `+${lengthscr:xxx}+` | 2.7 |
|
||||
Longueur de la chaîne affichée à l'écran, les codes couleurs sont ignorés. |
|
||||
`+${lengthscr:test}+` +
|
||||
`+${lengthscr:こんにちは世界}+` |
|
||||
`+4+` +
|
||||
`+14+`
|
||||
>> `+${lengthscr:test}+` +
|
||||
== `+4+` +
|
||||
+
|
||||
>> `+${lengthscr:こんにちは世界}+` +
|
||||
== `+14+`
|
||||
|
||||
| `+${split:number,seps,flags,xxx}+` | 3.3 |
|
||||
Chaîne découpée, et retour, selon `number` : +
|
||||
@@ -2730,24 +2774,32 @@ première étendue à la dernière) :
|
||||
- `keep_eol` : garder jusqu'à la fin de la ligne pour chaque valeur +
|
||||
- `strip_items=xyz` : supprimer les caractères `x`, `y` et `z` au début/fin des éléments +
|
||||
- `max_items=N` : retourner au plus N éléments |
|
||||
`+${split:1,,,abc,def,ghi}+` +
|
||||
`+${split:-1,,,abc,def,ghi}+` +
|
||||
`+${split:count,,,abc,def,ghi}+` +
|
||||
`+${split:random,,,abc,def,ghi}+` +
|
||||
`+${split:3,,collapse_seps,abc,,,def,,,ghi}+` +
|
||||
`+${split:3,,strip_items=-_,_-abc-_,_-def-_,_-ghi-_}+` +
|
||||
`+${split:2, ,,this is a test}+` +
|
||||
`+${split:2, ,strip_left+strip_right, this is a test }+` +
|
||||
`+${split:2, ,keep_eol,this is a test}+` |
|
||||
`+abc+` +
|
||||
`+ghi+` +
|
||||
`+3+` +
|
||||
`+def+` +
|
||||
`+ghi+` +
|
||||
`+ghi+` +
|
||||
`+is+` +
|
||||
`+is+` +
|
||||
`+is a test+`
|
||||
>> `+${split:1,,,abc,def,ghi}+` +
|
||||
== `+abc+` +
|
||||
+
|
||||
>> `+${split:-1,,,abc,def,ghi}+` +
|
||||
== `+ghi+` +
|
||||
+
|
||||
>> `+${split:count,,,abc,def,ghi}+` +
|
||||
== `+3+` +
|
||||
+
|
||||
>> `+${split:random,,,abc,def,ghi}+` +
|
||||
== `+def+` +
|
||||
+
|
||||
>> `+${split:3,,collapse_seps,abc,,,def,,,ghi}+` +
|
||||
== `+ghi+` +
|
||||
+
|
||||
>> `+${split:3,,strip_items=-_,_-abc-_,_-def-_,_-ghi-_}+` +
|
||||
== `+ghi+` +
|
||||
+
|
||||
>> `+${split:2, ,,this is a test}+` +
|
||||
== `+is+` +
|
||||
+
|
||||
>> `+${split:2, ,strip_left+strip_right, this is a test }+` +
|
||||
== `+is+` +
|
||||
+
|
||||
>> `+${split:2, ,keep_eol,this is a test}+` +
|
||||
== `+is a test+`
|
||||
|
||||
| `+${split_shell:number,xxx}+` | 3.3 |
|
||||
Paramètres shells découpés, et retour, selon `number` : +
|
||||
@@ -2755,14 +2807,17 @@ première étendue à la dernière) :
|
||||
- `random` : un paramètre au hasard +
|
||||
- entier ≥ 1 : le paramètre par son index (1 = premier paramètre) +
|
||||
- entier ≤ -1 : le paramètre par son index en partant de la fin (-1 = dernier paramètre, -2 = avant-dernier paramètre, etc.) |
|
||||
`+${split_shell:1,"first arg" arg2}+` +
|
||||
`+${split_shell:-1,"first arg" arg2}+` +
|
||||
`+${split_shell:count,"first arg" arg2}+` +
|
||||
`+${split_shell:random,"first arg" arg2}+` |
|
||||
`+first arg+` +
|
||||
`+arg2+` +
|
||||
`+2+` +
|
||||
`+arg2+`
|
||||
>> `+${split_shell:1,"first arg" arg2}+` +
|
||||
== `+first arg+` +
|
||||
+
|
||||
>> `+${split_shell:-1,"first arg" arg2}+` +
|
||||
== `+arg2+` +
|
||||
+
|
||||
>> `+${split_shell:count,"first arg" arg2}+` +
|
||||
== `+2+` +
|
||||
+
|
||||
>> `+${split_shell:random,"first arg" arg2}+` +
|
||||
== `+arg2+`
|
||||
|
||||
| `+${re:xxx}+` | 1.1 |
|
||||
Données sur l'expression régulière : +
|
||||
@@ -2771,74 +2826,90 @@ première étendue à la dernière) :
|
||||
`+++` = dernier groupe capturé, +
|
||||
`#` = index du dernier groupe capturé _(WeeChat ≥ 1.8)_ +
|
||||
`repl_index` = index du remplacement en cours (démarre à 1) _(WeeChat ≥ 3.3)_. |
|
||||
`+${re:0}+` +
|
||||
`+${re:1}+` +
|
||||
`+${re:2}+` +
|
||||
`+${re:+}+` +
|
||||
`+${re:#}+` +
|
||||
`+${re:repl_index}+` |
|
||||
`+test1 test2+` +
|
||||
`+test1+` +
|
||||
`+test2+` +
|
||||
`+test2+` +
|
||||
`+2+` +
|
||||
`+1+`
|
||||
>> `+${re:0}+` +
|
||||
== `+test1 test2+` +
|
||||
+
|
||||
>> `+${re:1}+` +
|
||||
== `+test1+` +
|
||||
+
|
||||
>> `+${re:2}+` +
|
||||
== `+test2+` +
|
||||
+
|
||||
>> `+${re:+}+` +
|
||||
== `+test2+` +
|
||||
+
|
||||
>> `+${re:#}+` +
|
||||
== `+2+` +
|
||||
+
|
||||
>> `+${re:repl_index}+` +
|
||||
== `+1+`
|
||||
|
||||
| `+${color:nom}+` | 0.4.2 |
|
||||
Code couleur WeeChat (le nom de couleur a des attributs facultatifs),
|
||||
voir la fonction <<_color,color>> pour les formats supportés. |
|
||||
`+${color:red}texte rouge+` +
|
||||
`+${color:*214}texte orange gras+` |
|
||||
`+texte rouge+` (en rouge) +
|
||||
`+texte orange gras+` (en orange gras)
|
||||
>> `+${color:red}texte rouge+` +
|
||||
== `+texte rouge+` ^(1)^ +
|
||||
+
|
||||
>> `+${color:*214}texte orange gras+` +
|
||||
== `+texte orange gras+` ^(2)^ +
|
||||
+
|
||||
^(1)^ En rouge +
|
||||
^(2)^ En orange gras
|
||||
|
||||
| `+${modifier:name,data,string}+` | 2.7 |
|
||||
Résultat d'un modificateur, voir la fonction
|
||||
<<_hook_modifier_exec,hook_modifier_exec>>. |
|
||||
`+${modifier:eval_path_home,,~}+` +
|
||||
`+${modifier:eval_path_home,directory=config,%h/weechat.conf}+` |
|
||||
`+/home/user+` +
|
||||
`+/home/user/.config/weechat/weechat.conf+`
|
||||
>> `+${modifier:eval_path_home,,~}+` +
|
||||
== `+/home/user+` +
|
||||
+
|
||||
>> `+${modifier:eval_path_home,directory=config,%h/irc.conf}+` +
|
||||
== `+/home/user/.config/weechat/irc.conf+`
|
||||
|
||||
| `+${info:nom}+` +
|
||||
`+${info:nom,paramètres}+` | 0.4.3 |
|
||||
Info de WeeChat ou d'une extension, voir la fonction <<_info_get,info_get>>. |
|
||||
`+${info:version}+` +
|
||||
`+${info:nick_color_name,foo}+` |
|
||||
`+1.0+` +
|
||||
`+lightblue+`
|
||||
>> `+${info:version}+` +
|
||||
== `+1.0+` +
|
||||
+
|
||||
>> `+${info:nick_color_name,foo}+` +
|
||||
== `+lightblue+`
|
||||
|
||||
| `+${base_encode:base,xxx}+` | 2.9 |
|
||||
Chaîne encodée en base 16, 32 ou 64. |
|
||||
`+${base_encode:16,test string}+` +
|
||||
`+${base_encode:32,test string}+` +
|
||||
`+${base_encode:64,test string}+` |
|
||||
`+7465737420737472696E67+` +
|
||||
`+ORSXG5BAON2HE2LOM4======+` +
|
||||
`+dGVzdCBzdHJpbmc=+`
|
||||
>> `+${base_encode:16,test string}+` +
|
||||
== `+7465737420737472696E67+` +
|
||||
+
|
||||
>> `+${base_encode:32,test string}+` +
|
||||
== `+ORSXG5BAON2HE2LOM4======+` +
|
||||
+
|
||||
>> `+${base_encode:64,test string}+` +
|
||||
== `+dGVzdCBzdHJpbmc=+`
|
||||
|
||||
| `+${base_decode:base,xxx}+` | 2.9 |
|
||||
Chaîne décodée depuis base 16, 32 ou 64. |
|
||||
`+${base_decode:16,7465737420737472696E67}+` +
|
||||
`+${base_decode:32,ORSXG5BAON2HE2LOM4======}+` +
|
||||
`+${base_decode:64,dGVzdCBzdHJpbmc=}+` |
|
||||
`+test string+` +
|
||||
`+test string+` +
|
||||
`+test string+`
|
||||
>> `+${base_decode:16,7465737420737472696E67}+` +
|
||||
== `+test string+` +
|
||||
+
|
||||
>> `+${base_decode:32,ORSXG5BAON2HE2LOM4======}+` +
|
||||
== `+test string+` +
|
||||
+
|
||||
>> `+${base_decode:64,dGVzdCBzdHJpbmc=}+` +
|
||||
== `+test string+`
|
||||
|
||||
| `+${date}+` +
|
||||
`+${date:xxx}+` | 1.3 |
|
||||
La date/heure courante, avec un format personnalisé (voir `man strftime`),
|
||||
le format par défaut est `%F %T`. |
|
||||
`+${date}+` +
|
||||
`+${date:%H:%M:%S}+` |
|
||||
`+2015-06-30 19:02:45+` +
|
||||
`+19:02:45+`
|
||||
>> `+${date}+` +
|
||||
== `+2015-06-30 19:02:45+` +
|
||||
+
|
||||
>> `+${date:%H:%M:%S}+` +
|
||||
== `+19:02:45+`
|
||||
|
||||
| `+${env:NOM}+` | 1.2 |
|
||||
Valeur de la variable d'environnement `NOM`. |
|
||||
`+${env:HOME}+` |
|
||||
`+/home/user+`
|
||||
>> `+${env:HOME}+` +
|
||||
== `+/home/user+`
|
||||
|
||||
| `+${if:condition}+` +
|
||||
`+${if:condition?vrai}+`
|
||||
@@ -2847,8 +2918,8 @@ première étendue à la dernière) :
|
||||
(optionnelle) et une autre valeur si la condition est fausse (optionnelle).
|
||||
Si les valeurs ne sont pas données, "1" ou "0" est retourné, selon le résultat
|
||||
de la condition. |
|
||||
`+${if:${info:term_width}>80?grand:petit}+` |
|
||||
`+grand+`
|
||||
>> `+${if:${info:term_width}>80?grand:petit}+` +
|
||||
== `+grand+`
|
||||
|
||||
| `+${calc:xxx}+` | 2.7 |
|
||||
Résultat de l'expression, où les parenthèses et les opérateurs suivants sont
|
||||
@@ -2860,55 +2931,62 @@ première étendue à la dernière) :
|
||||
`+//+` : résultat de la division sans la partie décimale +
|
||||
`+%+` : reste de la division +
|
||||
`+**+`: puissance. |
|
||||
`+${calc:5+2*3}+` +
|
||||
`+${calc:(5+2)*3}+` +
|
||||
`+${calc:10/4}+` +
|
||||
`+${calc:10//4}+` +
|
||||
`+${calc:9.2%3}+` +
|
||||
`+${calc:2**16}+` |
|
||||
`+11+` +
|
||||
`+21+` +
|
||||
`+2.5+` +
|
||||
`+2+` +
|
||||
`+0.2+` +
|
||||
`+65536+`
|
||||
>> `+${calc:5+2*3}+` +
|
||||
== `+11+` +
|
||||
+
|
||||
>> `+${calc:(5+2)*3}+` +
|
||||
== `+21+` +
|
||||
+
|
||||
>> `+${calc:10/4}+` +
|
||||
== `+2.5+` +
|
||||
+
|
||||
>> `+${calc:10//4}+` +
|
||||
== `+2+` +
|
||||
+
|
||||
>> `+${calc:9.2%3}+` +
|
||||
== `+0.2+` +
|
||||
+
|
||||
>> `+${calc:2**16}+` +
|
||||
== `+65536+`
|
||||
|
||||
| `+${random:min,max}+` | 3.3 |
|
||||
Nombre entier aléatoire dans l'intervalle de `min` à `max` (inclus). |
|
||||
`+${random:0,10}+` |
|
||||
`+3+`
|
||||
>> `+${random:0,10}+` +
|
||||
== `+3+`
|
||||
|
||||
| `+${translate:xxx}+` | 3.2 |
|
||||
Chaîne traduite (dépend de la langue utilisée par WeeChat pour afficher les
|
||||
messages). |
|
||||
`+${translate:Plugin}+` |
|
||||
`+Extension+` (exemple en Français)
|
||||
>> `+${translate:Plugin}+` +
|
||||
== `+Extension+` ^(1)^ +
|
||||
+
|
||||
^(1)^ Exemple en Français
|
||||
|
||||
| `+${define:nom,valeur}+` | 3.4 |
|
||||
Définir une variable `nom` à `valeur`, qui peut être utilisée dans la même
|
||||
expression évaluée avec `+${nom}+`. |
|
||||
`+${define:len,${calc:5+3}}${len}x${len}+` |
|
||||
`+8x8+`
|
||||
>> `+${define:len,${calc:5+3}}${len}x${len}+` +
|
||||
== `+8x8+`
|
||||
|
||||
| `+${sec.data.nom}+` | |
|
||||
Valeur de la donnée sécurisée `nom`. |
|
||||
`+${sec.data.libera_pass}+` |
|
||||
`+mon_mot_de_passe+`
|
||||
>> `+${sec.data.libera_pass}+` +
|
||||
== `+mon_mot_de_passe+`
|
||||
|
||||
| `+${fichier.section.option}+` | |
|
||||
Valeur de l'option. |
|
||||
`+${weechat.look.buffer_time_format}+` |
|
||||
`+%H:%M:%S+`
|
||||
>> `+${weechat.look.buffer_time_format}+` +
|
||||
== `+%H:%M:%S+`
|
||||
|
||||
| `+${nom}+` | |
|
||||
Valeur de la variable locale `nom` dans le tampon. |
|
||||
`+${nick}+` |
|
||||
`+FlashCode+`
|
||||
>> `+${nick}+` +
|
||||
== `+FlashCode+`
|
||||
|
||||
| `+${pointeur}+` | |
|
||||
Variable `pointeur` de la table de hachage _pointers_. |
|
||||
`+${buffer}+` |
|
||||
`+0x1234abcd+`
|
||||
>> `+${buffer}+` +
|
||||
== `+0x1234abcd+`
|
||||
|
||||
| `+${hdata.var1.var2...}+` +
|
||||
`+${hdata[list].var1.var2...}+` | |
|
||||
@@ -2916,11 +2994,14 @@ première étendue à la dernière) :
|
||||
avec la fenêtre et tampon courants), `list` peut être le nom d'une liste
|
||||
(exemple : "gui_buffers"), un pointeur (exemple : "0x1234abcd") ou un nom
|
||||
de pointeur (exemple : "mon_pointeur"). |
|
||||
`+${buffer[gui_buffers].full_name}+` +
|
||||
`+${buffer[mon_pointeur_buffer].full_name}+` +
|
||||
`+${window.buffer.number}+` |
|
||||
`+core.weechat+` +
|
||||
`+1+`
|
||||
>> `+${buffer[gui_buffers].full_name}+` +
|
||||
== `+core.weechat+` +
|
||||
+
|
||||
>> `+${buffer[mon_pointeur_buffer].full_name}+` +
|
||||
== `+core.weechat+` +
|
||||
+
|
||||
>> `+${window.buffer.number}+` +
|
||||
== `+1+`
|
||||
|===
|
||||
|
||||
==== string_dyn_alloc
|
||||
|
||||
+331
-250
@@ -2485,159 +2485,185 @@ str5 = weechat.string_eval_expression("password=abc password=def", {}, {}, optio
|
||||
List of logical operators that can be used in conditions (by order of priority,
|
||||
from first used to last):
|
||||
|
||||
[width="100%",cols="2,1,8,4,4",options="header"]
|
||||
[width="100%",cols="2,1,5,5",options="header"]
|
||||
|===
|
||||
| Operator | Min WeeChat | Description | Examples | Results
|
||||
| Operator | Min WeeChat | Description | Examples
|
||||
|
||||
| `+&&+` | |
|
||||
Logical "and" |
|
||||
`+25 && 77+` +
|
||||
`+25 && 0+` |
|
||||
`+1+` +
|
||||
`+0+`
|
||||
>> `+25 && 77+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+25 && 0+` +
|
||||
== `+0+`
|
||||
|
||||
| `+\|\|+` | |
|
||||
Logical "or" |
|
||||
`+25 \|\| 0+` +
|
||||
`+0 \|\| 0+` |
|
||||
`+1+` +
|
||||
`+0+`
|
||||
>> `+25 \|\| 0+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+0 \|\| 0+` +
|
||||
== `+0+`
|
||||
|===
|
||||
|
||||
List of comparison operators that can be used in conditions (by order of priority,
|
||||
from first used to last):
|
||||
|
||||
[width="100%",cols="2,1,8,4,4",options="header"]
|
||||
[width="100%",cols="2,1,5,5",options="header"]
|
||||
|===
|
||||
| Operator | Min WeeChat | Description | Examples | Results
|
||||
| Operator | Min WeeChat | Description | Examples
|
||||
|
||||
| `+=~+` | |
|
||||
Is matching POSIX extended regex (optional flags are allowed, see function <<_string_regcomp,string_regcomp>>) |
|
||||
`+abc def =~ ab.*ef+` +
|
||||
`+abc def =~ y.*z+` |
|
||||
`+1+` +
|
||||
`+0+`
|
||||
>> `+abc def =~ ab.*ef+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+abc def =~ y.*z+` +
|
||||
== `+0+`
|
||||
|
||||
| `+!~+` | |
|
||||
Is NOT matching POSIX extended regex (optional flags are allowed, see function <<_string_regcomp,string_regcomp>>) |
|
||||
`+abc def !~ ab.*ef+` +
|
||||
`+abc def !~ y.*z+` |
|
||||
`+0+` +
|
||||
`+1+`
|
||||
>> `+abc def !~ ab.*ef+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+abc def !~ y.*z+` +
|
||||
== `+1+`
|
||||
|
||||
| `+==*+` | 2.9 |
|
||||
Is matching mask where "*" is allowed, case sensitive (see function <<_string_match,string_match>>) |
|
||||
`+abc def ==* a*f+` +
|
||||
`+abc def ==* y*z+` |
|
||||
`+1+` +
|
||||
`+0+`
|
||||
>> `+abc def ==* a*f+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+abc def ==* y*z+` +
|
||||
== `+0+`
|
||||
|
||||
| `+!!*+` | 2.9 |
|
||||
Is NOT wildcard mask where "*" is allowed, case sensitive (see function <<_string_match,string_match>>) |
|
||||
`+abc def !!* a*f+` +
|
||||
`+abc def !!* y*z+` |
|
||||
`+0+` +
|
||||
`+1+`
|
||||
>> `+abc def !!* a*f+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+abc def !!* y*z+` +
|
||||
== `+1+`
|
||||
|
||||
| `+=*+` | 1.8 |
|
||||
Is matching mask where "*" is allowed, case insensitive (see function <<_string_match,string_match>>) |
|
||||
`+abc def =* A*F+` +
|
||||
`+abc def =* Y*Z+` |
|
||||
`+1+` +
|
||||
`+0+`
|
||||
>> `+abc def =* A*F+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+abc def =* Y*Z+` +
|
||||
== `+0+`
|
||||
|
||||
| `+!*+` | 1.8 |
|
||||
Is NOT wildcard mask where "*" is allowed, case insensitive (see function <<_string_match,string_match>>) |
|
||||
`+abc def !* A*F+` +
|
||||
`+abc def !* Y*Z+` |
|
||||
`+0+` +
|
||||
`+1+`
|
||||
>> `+abc def !* A*F+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+abc def !* Y*Z+` +
|
||||
== `+1+`
|
||||
|
||||
| `+==-+` | 2.9 |
|
||||
Is included, case sensitive |
|
||||
`+abc def ==- bc+` +
|
||||
`+abc def ==- xyz+` |
|
||||
`+1+` +
|
||||
`+0+`
|
||||
>> `+abc def ==- bc+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+abc def ==- xyz+` +
|
||||
== `+0+`
|
||||
|
||||
| `+!!-+` | 2.9 |
|
||||
Is NOT included, case sensitive |
|
||||
`+abc def !!- bc+` +
|
||||
`+abc def !!- xyz+` |
|
||||
`+0+` +
|
||||
`+1+`
|
||||
>> `+abc def !!- bc+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+abc def !!- xyz+` +
|
||||
== `+1+`
|
||||
|
||||
| `+=-+` | 2.9 |
|
||||
Is included, case insensitive |
|
||||
`+abc def =- BC+` +
|
||||
`+abc def =- XYZ+` |
|
||||
`+1+` +
|
||||
`+0+`
|
||||
>> `+abc def =- BC+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+abc def =- XYZ+` +
|
||||
== `+0+`
|
||||
|
||||
| `+!-+` | 2.9 |
|
||||
Is NOT included, case insensitive |
|
||||
`+abc def !- BC+` +
|
||||
`+abc def !- XYZ+` |
|
||||
`+0+` +
|
||||
`+1+`
|
||||
>> `+abc def !- BC+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+abc def !- XYZ+` +
|
||||
== `+1+`
|
||||
|
||||
| `+==+` | |
|
||||
Equal |
|
||||
`+test == test+` +
|
||||
`+test == string+` |
|
||||
`+1+` +
|
||||
`+0+`
|
||||
>> `+test == test+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+test == string+` +
|
||||
== `+0+`
|
||||
|
||||
| `+!=+` | |
|
||||
Not equal |
|
||||
`+test != test+` +
|
||||
`+test != string+` |
|
||||
`+0+` +
|
||||
`+1+`
|
||||
>> `+test != test+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+test != string+` +
|
||||
== `+1+`
|
||||
|
||||
| `+<=+` | |
|
||||
Less or equal |
|
||||
`+abc <= defghi+` +
|
||||
`+abc <= abc+` +
|
||||
`+defghi <= abc+` +
|
||||
`+15 <= 2+` |
|
||||
`+1+` +
|
||||
`+1+` +
|
||||
`+0+` +
|
||||
`+0+`
|
||||
>> `+abc <= defghi+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+abc <= abc+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+defghi <= abc+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+15 <= 2+` +
|
||||
== `+0+`
|
||||
|
||||
| `+<+` | |
|
||||
Less |
|
||||
`+abc < defghi+` +
|
||||
`+abc < abc+` +
|
||||
`+defghi < abc+` +
|
||||
`+15 < 2+` |
|
||||
`+1+` +
|
||||
`+0+` +
|
||||
`+0+` +
|
||||
`+0+`
|
||||
>> `+abc < defghi+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+abc < abc+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+defghi < abc+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+15 < 2+` +
|
||||
== `+0+`
|
||||
|
||||
| `+>=+` | |
|
||||
Greater or equal |
|
||||
`+defghi >= abc+` +
|
||||
`+abc >= abc+` +
|
||||
`+abc >= defghi+` +
|
||||
`+15 >= 2+` |
|
||||
`+1+` +
|
||||
`+1+` +
|
||||
`+0+` +
|
||||
`+1+`
|
||||
>> `+defghi >= abc+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+abc >= abc+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+abc >= defghi+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+15 >= 2+` +
|
||||
== `+1+`
|
||||
|
||||
| `+>+` | |
|
||||
Greater |
|
||||
`+defghi > abc+` +
|
||||
`+abc > abc+` +
|
||||
`+abc > defghi+` +
|
||||
`+15 > 2+` |
|
||||
`+1+` +
|
||||
`+0+` +
|
||||
`+0+` +
|
||||
`+1+`
|
||||
>> `+defghi > abc+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+abc > abc+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+abc > defghi+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+15 > 2+` +
|
||||
== `+1+`
|
||||
|===
|
||||
|
||||
The comparison is made using floating point numbers if the two expressions are
|
||||
@@ -2659,116 +2685,134 @@ for example:
|
||||
List of variables expanded in expression (by order of priority, from first
|
||||
expanded to last):
|
||||
|
||||
[width="100%",cols="2,1,8,4,4",options="header"]
|
||||
[width="100%",cols="2,1,5,5",options="header"]
|
||||
|===
|
||||
| Format | Min WeeChat | Description | Examples | Results
|
||||
| Format | Min WeeChat | Description | Examples
|
||||
|
||||
| `+${raw:xxx}+` | 3.1 |
|
||||
Raw string (not evaluated). |
|
||||
`+${raw:${info:version}}+` |
|
||||
`+${info:version}+`
|
||||
>> `+${raw:${info:version}}+` +
|
||||
== `+${info:version}+`
|
||||
|
||||
| `+${name}+` | 3.4 |
|
||||
User variable (defined with `+${define:name,value}+`). |
|
||||
`+${name}+` |
|
||||
`+value+`
|
||||
>> `+${name}+` +
|
||||
== `+value+`
|
||||
|
||||
| `+${name}+` | |
|
||||
Variable `name` from hashtable _extra_vars_. |
|
||||
`+${name}+` |
|
||||
`+value+`
|
||||
>> `+${name}+` +
|
||||
== `+value+`
|
||||
|
||||
| `+${weechat_xxx_dir}+` | 3.2 |
|
||||
A WeeChat directory: `+${weechat_config_dir}+`, `+${weechat_data_dir}+`,
|
||||
`+${weechat_cache_dir}+` or `+${weechat_runtime_dir}+`. |
|
||||
`+${weechat_config_dir}+` +
|
||||
`+${weechat_data_dir}+` +
|
||||
`+${weechat_cache_dir}+` +
|
||||
`+${weechat_runtime_dir}+` |
|
||||
`+/home/user/.config/weechat+` +
|
||||
`+/home/user/.local/share/weechat+` +
|
||||
`+/home/user/.cache/weechat+` +
|
||||
`+/run/user/1000/weechat+`
|
||||
>> `+${weechat_config_dir}+` +
|
||||
== `+/home/user/.config/weechat+` +
|
||||
+
|
||||
>> `+${weechat_data_dir}+` +
|
||||
== `+/home/user/.local/share/weechat+` +
|
||||
+
|
||||
>> `+${weechat_cache_dir}+` +
|
||||
== `+/home/user/.cache/weechat+` +
|
||||
+
|
||||
>> `+${weechat_runtime_dir}+` +
|
||||
== `+/run/user/1000/weechat+`
|
||||
|
||||
| `+${eval:xxx}+` | 1.3 |
|
||||
String to evaluate. |
|
||||
`+${eval:${date:${weechat.look.buffer_time_format}}}+` |
|
||||
`+19:02:45+` (with colors if there are color codes in the option
|
||||
weechat.look.buffer_time_format)
|
||||
>> `+${eval:${date:${weechat.look.buffer_time_format}}}+` +
|
||||
== `+19:02:45+` ^(1)^ +
|
||||
+
|
||||
^(1)^ With colors if there are color codes in the option
|
||||
weechat.look.buffer_time_format
|
||||
|
||||
| `+${eval_cond:xxx}+` | 3.1 |
|
||||
String to evaluate as condition. |
|
||||
`+${eval_cond:${window.win_width} > 100}+` |
|
||||
`+1+`
|
||||
>> `+${eval_cond:${window.win_width} > 100}+` +
|
||||
== `+1+`
|
||||
|
||||
| `+${esc:xxx}+` +
|
||||
`+${\xxx}+` | 1.0 |
|
||||
String with escaped chars. |
|
||||
`+${esc:prefix\tmessage}+` +
|
||||
`+${\ua9}+` |
|
||||
`+prefix<TAB>message+` +
|
||||
`+©+`
|
||||
>> `+${esc:prefix\tmessage}+` +
|
||||
== `+prefix<TAB>message+` +
|
||||
+
|
||||
>> `+${\ua9}+` +
|
||||
== `+©+`
|
||||
|
||||
| `+${hide:x,string}+` | 1.1 |
|
||||
String with hidden chars (all chars in `string` replaced `x`). |
|
||||
`+${hide:*,password}+` |
|
||||
`+********+`
|
||||
>> `+${hide:*,password}+` +
|
||||
== `+********+`
|
||||
|
||||
| `+${cut:max,suffix,string}+` +
|
||||
`+${cut:+max,suffix,string}+` | 1.8 |
|
||||
String with `max` chars, and optional `suffix` if string is cut. +
|
||||
With the format `+max`, the suffix is counted in max length. |
|
||||
`+${cut:4,…,this is a test}+` +
|
||||
`+${cut:+4,…,this is a test}+` +
|
||||
`+${cut:2,>>,こんにちは世界}+` |
|
||||
`+this…+` +
|
||||
`+t…+` +
|
||||
`+こん>>+`
|
||||
>> `+${cut:4,…,this is a test}+` +
|
||||
== `+this…+` +
|
||||
+
|
||||
>> `+${cut:+4,…,this is a test}+` +
|
||||
== `+t…+` +
|
||||
+
|
||||
>> `+${cut:2,>>,こんにちは世界}+` +
|
||||
== `+こん>>+`
|
||||
|
||||
| `+${cutscr:max,suffix,string}+` +
|
||||
`+${cutscr:+max,suffix,string}+` | 1.8 |
|
||||
String with `max` chars displayed on screen, and optional `suffix` if string is cut. +
|
||||
With the format `+max`, the suffix is counted in max length. |
|
||||
`+${cutscr:4,…,this is a test}+` +
|
||||
`+${cutscr:+4,…,this is a test}+` +
|
||||
`+${cutscr:2,>>,こんにちは世界}+` |
|
||||
`+this…+` +
|
||||
`+thi…+` +
|
||||
`+こ>>+`
|
||||
>> `+${cutscr:4,…,this is a test}+` +
|
||||
== `+this…+` +
|
||||
+
|
||||
>> `+${cutscr:+4,…,this is a test}+` +
|
||||
== `+thi…+` +
|
||||
+
|
||||
>> `+${cutscr:2,>>,こんにちは世界}+` +
|
||||
== `+こ>>+`
|
||||
|
||||
| `+${rev:xxx}+` | 2.2 |
|
||||
Reversed string (color codes are reversed, so the string should not contain
|
||||
color codes). |
|
||||
`+${rev:Hello, world!}+` +
|
||||
`+${rev:Hello, ${color:red}world!}+` |
|
||||
`+!dlrow ,olleH+` +
|
||||
`+!dlrow30F ,olleH+` (no color, the color code is reversed)
|
||||
>> `+${rev:Hello, world!}+` +
|
||||
== `+!dlrow ,olleH+` +
|
||||
+
|
||||
>> `+${rev:Hello, ${color:red}world!}+` +
|
||||
== `+!dlrow30F ,olleH+` ^(1)^ +
|
||||
+
|
||||
^(1)^ No color, the color code is reversed
|
||||
|
||||
| `+${revscr:xxx}+` | 2.7 |
|
||||
Reversed string for screen, color codes are not reversed. |
|
||||
`+${revscr:Hello, world!}+` +
|
||||
`+${revscr:Hello, ${color:red}world!}+` |
|
||||
`+!dlrow ,olleH+` +
|
||||
`+!dlrow ,olleH+` (`pass:[ ,olleH]` in red)
|
||||
>> `+${revscr:Hello, world!}+` +
|
||||
== `+!dlrow ,olleH+` +
|
||||
+
|
||||
>> `+${revscr:Hello, ${color:red}world!}+` +
|
||||
== `+!dlrow ,olleH+` ^(1)^ +
|
||||
+
|
||||
^(1)^ `pass:[ ,olleH]` in red
|
||||
|
||||
| `+${repeat:count,string}+` | 2.3 |
|
||||
Repeated string. |
|
||||
`+${repeat:5,-}+` |
|
||||
`+-----+`
|
||||
>> `+${repeat:5,-}+` +
|
||||
== `+-----+`
|
||||
|
||||
| `+${length:xxx}+` | 2.7 |
|
||||
Length of string (number of UTF-8 chars), color codes are ignored. |
|
||||
`+${length:test}+` +
|
||||
`+${length:こんにちは世界}+` |
|
||||
`+4+` +
|
||||
`+7+`
|
||||
>> `+${length:test}+` +
|
||||
== `+4+` +
|
||||
+
|
||||
>> `+${length:こんにちは世界}+` +
|
||||
== `+7+`
|
||||
|
||||
| `+${lengthscr:xxx}+` | 2.7 |
|
||||
Length of string displayed on screen, color codes are ignored. |
|
||||
`+${lengthscr:test}+` +
|
||||
`+${lengthscr:こんにちは世界}+` |
|
||||
`+4+` +
|
||||
`+14+`
|
||||
>> `+${lengthscr:test}+` +
|
||||
== `+4+` +
|
||||
+
|
||||
>> `+${lengthscr:こんにちは世界}+` +
|
||||
== `+14+`
|
||||
|
||||
| `+${split:number,seps,flags,xxx}+` | 3.3 |
|
||||
Split string, and return, according to `number`: +
|
||||
@@ -2784,24 +2828,32 @@ expanded to last):
|
||||
- `keep_eol`: keep end of line for each value +
|
||||
- `strip_items=xyz`: strip chars `x`, `y` and `z` from beginning/end of items +
|
||||
- `max_items=N`: return max N items |
|
||||
`+${split:1,,,abc,def,ghi}+` +
|
||||
`+${split:-1,,,abc,def,ghi}+` +
|
||||
`+${split:count,,,abc,def,ghi}+` +
|
||||
`+${split:random,,,abc,def,ghi}+` +
|
||||
`+${split:3,,collapse_seps,abc,,,def,,,ghi}+` +
|
||||
`+${split:3,,strip_items=-_,_-abc-_,_-def-_,_-ghi-_}+` +
|
||||
`+${split:2, ,,this is a test}+` +
|
||||
`+${split:2, ,strip_left+strip_right, this is a test }+` +
|
||||
`+${split:2, ,keep_eol,this is a test}+` |
|
||||
`+abc+` +
|
||||
`+ghi+` +
|
||||
`+3+` +
|
||||
`+def+` +
|
||||
`+ghi+` +
|
||||
`+ghi+` +
|
||||
`+is+` +
|
||||
`+is+` +
|
||||
`+is a test+`
|
||||
>> `+${split:1,,,abc,def,ghi}+` +
|
||||
== `+abc+` +
|
||||
+
|
||||
>> `+${split:-1,,,abc,def,ghi}+` +
|
||||
== `+ghi+` +
|
||||
+
|
||||
>> `+${split:count,,,abc,def,ghi}+` +
|
||||
== `+3+` +
|
||||
+
|
||||
>> `+${split:random,,,abc,def,ghi}+` +
|
||||
== `+def+` +
|
||||
+
|
||||
>> `+${split:3,,collapse_seps,abc,,,def,,,ghi}+` +
|
||||
== `+ghi+` +
|
||||
+
|
||||
>> `+${split:3,,strip_items=-_,_-abc-_,_-def-_,_-ghi-_}+` +
|
||||
== `+ghi+` +
|
||||
+
|
||||
>> `+${split:2, ,,this is a test}+` +
|
||||
== `+is+` +
|
||||
+
|
||||
>> `+${split:2, ,strip_left+strip_right, this is a test }+` +
|
||||
== `+is+` +
|
||||
+
|
||||
>> `+${split:2, ,keep_eol,this is a test}+` +
|
||||
== `+is a test+`
|
||||
|
||||
| `+${split_shell:number,xxx}+` | 3.3 |
|
||||
Split shell arguments, and return, according to `number`: +
|
||||
@@ -2809,14 +2861,17 @@ expanded to last):
|
||||
- `random`: a random argument +
|
||||
- integer ≥ 1: the argument by index (1 = first argument) +
|
||||
- integer ≤ -1: the argument by index from the end (-1 = last argument, -2 = penultimate argument, etc.) |
|
||||
`+${split_shell:1,"first arg" arg2}+` +
|
||||
`+${split_shell:-1,"first arg" arg2}+` +
|
||||
`+${split_shell:count,"first arg" arg2}+` +
|
||||
`+${split_shell:random,"first arg" arg2}+` |
|
||||
`+first arg+` +
|
||||
`+arg2+` +
|
||||
`+2+` +
|
||||
`+arg2+`
|
||||
>> `+${split_shell:1,"first arg" arg2}+` +
|
||||
== `+first arg+` +
|
||||
+
|
||||
>> `+${split_shell:-1,"first arg" arg2}+` +
|
||||
== `+arg2+` +
|
||||
+
|
||||
>> `+${split_shell:count,"first arg" arg2}+` +
|
||||
== `+2+` +
|
||||
+
|
||||
>> `+${split_shell:random,"first arg" arg2}+` +
|
||||
== `+arg2+`
|
||||
|
||||
| `+${re:xxx}+` | 1.1 |
|
||||
Regex data: +
|
||||
@@ -2825,74 +2880,90 @@ expanded to last):
|
||||
`+++` = last group captured, +
|
||||
`#` = index of last group captured _(WeeChat ≥ 1.8)_, +
|
||||
`repl_index` = index of replacement being done (starts to 1) _(WeeChat ≥ 3.3)_. |
|
||||
`+${re:0}+` +
|
||||
`+${re:1}+` +
|
||||
`+${re:2}+` +
|
||||
`+${re:+}+` +
|
||||
`+${re:#}+` +
|
||||
`+${re:repl_index}+` |
|
||||
`+test1 test2+` +
|
||||
`+test1+` +
|
||||
`+test2+` +
|
||||
`+test2+` +
|
||||
`+2+` +
|
||||
`+1+`
|
||||
>> `+${re:0}+` +
|
||||
== `+test1 test2+` +
|
||||
+
|
||||
>> `+${re:1}+` +
|
||||
== `+test1+` +
|
||||
+
|
||||
>> `+${re:2}+` +
|
||||
== `+test2+` +
|
||||
+
|
||||
>> `+${re:+}+` +
|
||||
== `+test2+` +
|
||||
+
|
||||
>> `+${re:#}+` +
|
||||
== `+2+` +
|
||||
+
|
||||
>> `+${re:repl_index}+` +
|
||||
== `+1+`
|
||||
|
||||
| `+${color:name}+` | 0.4.2 |
|
||||
WeeChat color code (the name of color has optional attributes),
|
||||
see function <<_color,color>> for supported formats. |
|
||||
`+${color:red}red text+` +
|
||||
`+${color:*214}bold orange text+` |
|
||||
`+red text+` (in red) +
|
||||
`+bold orange text+` (in bold orange)
|
||||
>> `+${color:red}red text+` +
|
||||
== `+red text+` ^(1)^ +
|
||||
+
|
||||
>> `+${color:*214}bold orange text+` +
|
||||
== `+bold orange text+` ^(2)^ +
|
||||
+
|
||||
^(1)^ In red +
|
||||
^(2)^ In bold orange
|
||||
|
||||
| `+${modifier:name,data,string}+` | 2.7 |
|
||||
Result of a modifier, see function
|
||||
<<_hook_modifier_exec,hook_modifier_exec>>. |
|
||||
`+${modifier:eval_path_home,,~}+` +
|
||||
`+${modifier:eval_path_home,directory=config,%h/weechat.conf}+` |
|
||||
`+/home/user+` +
|
||||
`+/home/user/.config/weechat/weechat.conf+`
|
||||
>> `+${modifier:eval_path_home,,~}+` +
|
||||
== `+/home/user+` +
|
||||
+
|
||||
>> `+${modifier:eval_path_home,directory=config,%h/irc.conf}+` +
|
||||
== `+/home/user/.config/weechat/irc.conf+`
|
||||
|
||||
| `+${info:name}+` +
|
||||
`+${info:name,arguments}+` | 0.4.3 |
|
||||
Info from WeeChat or a plugin, see function <<_info_get,info_get>>. |
|
||||
`+${info:version}+` +
|
||||
`+${info:nick_color_name,foo}+` |
|
||||
`+1.0+` +
|
||||
`+lightblue+`
|
||||
>> `+${info:version}+` +
|
||||
== `+1.0+` +
|
||||
+
|
||||
>> `+${info:nick_color_name,foo}+` +
|
||||
== `+lightblue+`
|
||||
|
||||
| `+${base_encode:base,xxx}+` | 2.9 |
|
||||
String encoded in base 16, 32 or 64. |
|
||||
`+${base_encode:16,test string}+` +
|
||||
`+${base_encode:32,test string}+` +
|
||||
`+${base_encode:64,test string}+` |
|
||||
`+7465737420737472696E67+` +
|
||||
`+ORSXG5BAON2HE2LOM4======+` +
|
||||
`+dGVzdCBzdHJpbmc=+`
|
||||
>> `+${base_encode:16,test string}+` +
|
||||
== `+7465737420737472696E67+` +
|
||||
+
|
||||
>> `+${base_encode:32,test string}+` +
|
||||
== `+ORSXG5BAON2HE2LOM4======+` +
|
||||
+
|
||||
>> `+${base_encode:64,test string}+` +
|
||||
== `+dGVzdCBzdHJpbmc=+`
|
||||
|
||||
| `+${base_decode:base,xxx}+` | 2.9 |
|
||||
String decoded from base 16, 32 or 64. |
|
||||
`+${base_decode:16,7465737420737472696E67}+` +
|
||||
`+${base_decode:32,ORSXG5BAON2HE2LOM4======}+` +
|
||||
`+${base_decode:64,dGVzdCBzdHJpbmc=}+` |
|
||||
`+test string+` +
|
||||
`+test string+` +
|
||||
`+test string+`
|
||||
>> `+${base_decode:16,7465737420737472696E67}+` +
|
||||
== `+test string+` +
|
||||
+
|
||||
>> `+${base_decode:32,ORSXG5BAON2HE2LOM4======}+` +
|
||||
== `+test string+` +
|
||||
+
|
||||
>> `+${base_decode:64,dGVzdCBzdHJpbmc=}+` +
|
||||
== `+test string+`
|
||||
|
||||
| `+${date}+` +
|
||||
`+${date:xxx}+` | 1.3 |
|
||||
Current date/time, with custom format (see `man strftime`),
|
||||
default format is `%F %T`. |
|
||||
`+${date}+` +
|
||||
`+${date:%H:%M:%S}+` |
|
||||
`+2015-06-30 19:02:45+` +
|
||||
`+19:02:45+`
|
||||
>> `+${date}+` +
|
||||
== `+2015-06-30 19:02:45+` +
|
||||
+
|
||||
>> `+${date:%H:%M:%S}+` +
|
||||
== `+19:02:45+`
|
||||
|
||||
| `+${env:NAME}+` | 1.2 |
|
||||
Value of the environment variable `NAME`. |
|
||||
`+${env:HOME}+` |
|
||||
`+/home/user+`
|
||||
>> `+${env:HOME}+` +
|
||||
== `+/home/user+`
|
||||
|
||||
| `+${if:condition}+` +
|
||||
`+${if:condition?true}+`
|
||||
@@ -2900,8 +2971,8 @@ expanded to last):
|
||||
Ternary operator with a condition, a value if the condition is true (optional)
|
||||
and another value if the condition is false (optional). If values are not
|
||||
given, "1" or "0" are returned, according to the result of the condition. |
|
||||
`+${if:${info:term_width}>80?big:small}+` |
|
||||
`+big+`
|
||||
>> `+${if:${info:term_width}>80?big:small}+` +
|
||||
== `+big+`
|
||||
|
||||
| `+${calc:xxx}+` | 2.7 |
|
||||
Result of expression, where parentheses and the following operators are
|
||||
@@ -2913,65 +2984,75 @@ expanded to last):
|
||||
`+//+`: result of division without fractional part +
|
||||
`+%+`: remainder of division +
|
||||
`+**+`: power. |
|
||||
`+${calc:5+2*3}+` +
|
||||
`+${calc:(5+2)*3}+` +
|
||||
`+${calc:10/4}+` +
|
||||
`+${calc:10//4}+` +
|
||||
`+${calc:9.2%3}+` +
|
||||
`+${calc:2**16}+` |
|
||||
`+11+` +
|
||||
`+21+` +
|
||||
`+2.5+` +
|
||||
`+2+` +
|
||||
`+0.2+` +
|
||||
`+65536+`
|
||||
>> `+${calc:5+2*3}+` +
|
||||
== `+11+` +
|
||||
+
|
||||
>> `+${calc:(5+2)*3}+` +
|
||||
== `+21+` +
|
||||
+
|
||||
>> `+${calc:10/4}+` +
|
||||
== `+2.5+` +
|
||||
+
|
||||
>> `+${calc:10//4}+` +
|
||||
== `+2+` +
|
||||
+
|
||||
>> `+${calc:9.2%3}+` +
|
||||
== `+0.2+` +
|
||||
+
|
||||
>> `+${calc:2**16}+` +
|
||||
== `+65536+`
|
||||
|
||||
| `+${random:min,max}+` | 3.3 |
|
||||
Random integer number in the range from `min` to `max` (inclusive). |
|
||||
`+${random:0,10}+` |
|
||||
`+3+`
|
||||
>> `+${random:0,10}+` +
|
||||
== `+3+`
|
||||
|
||||
| `+${translate:xxx}+` | 3.2 |
|
||||
Translated string (depends on the language used by WeeChat to display messages). |
|
||||
`+${translate:Plugin}+` |
|
||||
`+Extension+` (example in French)
|
||||
>> `+${translate:Plugin}+` +
|
||||
== `+Extension+` ^(1)^ +
|
||||
+
|
||||
^(1)^ Example in French
|
||||
|
||||
| `+${define:name,value}+` | 3.4 |
|
||||
Define a variable `name` set to `value`, which can then be used in the same
|
||||
evaluated expression with `+${name}+`. |
|
||||
`+${define:len,${calc:5+3}}${len}x${len}+` |
|
||||
`+8x8+`
|
||||
>> `+${define:len,${calc:5+3}}${len}x${len}+` +
|
||||
== `+8x8+`
|
||||
|
||||
| `+${sec.data.name}+` | |
|
||||
Value of the secured data `name`. |
|
||||
`+${sec.data.libera_pass}+` |
|
||||
`+my_password+`
|
||||
>> `+${sec.data.libera_pass}+` +
|
||||
== `+my_password+`
|
||||
|
||||
| `+${file.section.option}+` | |
|
||||
Value of the option. |
|
||||
`+${weechat.look.buffer_time_format}+` |
|
||||
`+%H:%M:%S+`
|
||||
>> `+${weechat.look.buffer_time_format}+` +
|
||||
== `+%H:%M:%S+`
|
||||
|
||||
| `+${name}+` | |
|
||||
Value of local variable `name` in buffer. |
|
||||
`+${nick}+` |
|
||||
`+FlashCode+`
|
||||
>> `+${nick}+` +
|
||||
== `+FlashCode+`
|
||||
|
||||
| `+${pointer}+` | |
|
||||
Variable `pointer` from hashtable _pointers_. |
|
||||
`+${buffer}+` |
|
||||
`+0x1234abcd+`
|
||||
>> `+${buffer}+` +
|
||||
== `+0x1234abcd+`
|
||||
|
||||
| `+${hdata.var1.var2...}+` +
|
||||
`+${hdata[list].var1.var2...}+` | |
|
||||
Hdata value (pointers `window` and `buffer` are set by default with current
|
||||
window/buffer), `list` can be a list name (example: "gui_buffers"), a pointer
|
||||
(example: "0x1234abcd") or a pointer name (example: "my_pointer"). |
|
||||
`+${buffer[gui_buffers].full_name}+` +
|
||||
`+${buffer[my_buffer_pointer].full_name}+` +
|
||||
`+${window.buffer.number}+` |
|
||||
`+core.weechat+` +
|
||||
`+1+`
|
||||
>> `+${buffer[gui_buffers].full_name}+` +
|
||||
== `+core.weechat+` +
|
||||
+
|
||||
>> `+${buffer[my_buffer_pointer].full_name}+` +
|
||||
== `+core.weechat+` +
|
||||
+
|
||||
>> `+${window.buffer.number}+` +
|
||||
== `+1+`
|
||||
|===
|
||||
|
||||
==== string_dyn_alloc
|
||||
|
||||
+330
-250
@@ -2410,169 +2410,195 @@ str5 = weechat.string_eval_expression("password=abc password=def", {}, {}, optio
|
||||
条件に使える論理演算子のリスト
|
||||
(上から優先順位の高い順):
|
||||
|
||||
[width="100%",cols="2,1,8,4,4",options="header"]
|
||||
[width="100%",cols="2,1,5,5",options="header"]
|
||||
|===
|
||||
// TRANSLATION MISSING
|
||||
| 演算子 | Min WeeChat | 説明 | 例 | 結果
|
||||
| 演算子 | Min WeeChat | 説明 | 例
|
||||
|
||||
| `+&&+` | |
|
||||
論理積 |
|
||||
`+25 && 77+` +
|
||||
`+25 && 0+` |
|
||||
`+1+` +
|
||||
`+0+`
|
||||
>> `+25 && 77+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+25 && 0+` +
|
||||
== `+0+`
|
||||
|
||||
| `+\|\|+` | |
|
||||
論理和 |
|
||||
`+25 \|\| 0+` +
|
||||
`+0 \|\| 0+` |
|
||||
`+1+` +
|
||||
`+0+`
|
||||
>> `+25 \|\| 0+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+0 \|\| 0+` +
|
||||
== `+0+`
|
||||
|===
|
||||
|
||||
条件に使える比較演算子のリスト
|
||||
(上から優先順位の高い順):
|
||||
|
||||
[width="100%",cols="2,1,8,4,4",options="header"]
|
||||
[width="100%",cols="2,1,5,5",options="header"]
|
||||
|===
|
||||
// TRANSLATION MISSING
|
||||
| 演算子 | Min WeeChat | 説明 | 例 | 結果
|
||||
| 演算子 | Min WeeChat | 説明 | 例
|
||||
|
||||
| `+=~+` | |
|
||||
POSIX 拡張正規表現にマッチ (任意でフラグを指定することも可能です、関数 <<_string_regcomp,string_regcomp>> を確認してください) |
|
||||
`+abc def =~ ab.*ef+` +
|
||||
`+abc def =~ y.*z+` |
|
||||
`+1+` +
|
||||
`+0+`
|
||||
>> `+abc def =~ ab.*ef+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+abc def =~ y.*z+` +
|
||||
== `+0+`
|
||||
|
||||
| `+!~+` | |
|
||||
POSIX 拡張正規表現にマッチしない (任意でフラグを指定することも可能です、関数 <<_string_regcomp,string_regcomp>> を確認してください) |
|
||||
`+abc def !~ ab.*ef+` +
|
||||
`+abc def !~ y.*z+` |
|
||||
`+0+` +
|
||||
`+1+`
|
||||
>> `+abc def !~ ab.*ef+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+abc def !~ y.*z+` +
|
||||
== `+1+`
|
||||
|
||||
// TRANSLATION MISSING
|
||||
| `+==*+` | 2.9 |
|
||||
Is matching mask where "*" is allowed, case sensitive (see function <<_string_match,string_match>>) |
|
||||
`+abc def ==* a*f+` +
|
||||
`+abc def ==* y*z+` |
|
||||
`+1+` +
|
||||
`+0+`
|
||||
>> `+abc def ==* a*f+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+abc def ==* y*z+` +
|
||||
== `+0+`
|
||||
|
||||
// TRANSLATION MISSING
|
||||
| `+!!*+` | 2.9 |
|
||||
Is NOT wildcard mask where "*" is allowed, case sensitive (see function <<_string_match,string_match>>) |
|
||||
`+abc def !!* a*f+` +
|
||||
`+abc def !!* y*z+` |
|
||||
`+0+` +
|
||||
`+1+`
|
||||
>> `+abc def !!* a*f+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+abc def !!* y*z+` +
|
||||
== `+1+`
|
||||
|
||||
// TRANSLATION MISSING
|
||||
| `+=*+` | 1.8 |
|
||||
Is matching mask where "*" is allowed, case insensitive (see function <<_string_match,string_match>>) |
|
||||
`+abc def =* A*F+` +
|
||||
`+abc def =* Y*Z+` |
|
||||
`+1+` +
|
||||
`+0+`
|
||||
>> `+abc def =* A*F+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+abc def =* Y*Z+` +
|
||||
== `+0+`
|
||||
|
||||
// TRANSLATION MISSING
|
||||
| `+!*+` | 1.8 |
|
||||
Is NOT wildcard mask where "*" is allowed, case insensitive (see function <<_string_match,string_match>>) |
|
||||
`+abc def !* A*F+` +
|
||||
`+abc def !* Y*Z+` |
|
||||
`+0+` +
|
||||
`+1+`
|
||||
>> `+abc def !* A*F+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+abc def !* Y*Z+` +
|
||||
== `+1+`
|
||||
|
||||
// TRANSLATION MISSING
|
||||
| `+==-+` | 2.9 |
|
||||
Is included, case sensitive |
|
||||
`+abc def ==- bc+` +
|
||||
`+abc def ==- xyz+` |
|
||||
`+1+` +
|
||||
`+0+`
|
||||
>> `+abc def ==- bc+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+abc def ==- xyz+` +
|
||||
== `+0+`
|
||||
|
||||
// TRANSLATION MISSING
|
||||
| `+!!-+` | 2.9 |
|
||||
Is NOT included, case sensitive |
|
||||
`+abc def !!- bc+` +
|
||||
`+abc def !!- xyz+` |
|
||||
`+0+` +
|
||||
`+1+`
|
||||
>> `+abc def !!- bc+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+abc def !!- xyz+` +
|
||||
== `+1+`
|
||||
|
||||
// TRANSLATION MISSING
|
||||
| `+=-+` | 2.9 |
|
||||
Is included, case insensitive |
|
||||
`+abc def =- BC+` +
|
||||
`+abc def =- XYZ+` |
|
||||
`+1+` +
|
||||
`+0+`
|
||||
>> `+abc def =- BC+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+abc def =- XYZ+` +
|
||||
== `+0+`
|
||||
|
||||
// TRANSLATION MISSING
|
||||
| `+!-+` | 2.9 |
|
||||
Is NOT included, case insensitive |
|
||||
`+abc def !- BC+` +
|
||||
`+abc def !- XYZ+` |
|
||||
`+0+` +
|
||||
`+1+`
|
||||
>> `+abc def !- BC+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+abc def !- XYZ+` +
|
||||
== `+1+`
|
||||
|
||||
| `+==+` | |
|
||||
等しい |
|
||||
`+test == test+` +
|
||||
`+test == string+` |
|
||||
`+1+` +
|
||||
`+0+`
|
||||
>> `+test == test+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+test == string+` +
|
||||
== `+0+`
|
||||
|
||||
| `+!=+` | |
|
||||
等しくない |
|
||||
`+test != test+` +
|
||||
`+test != string+` |
|
||||
`+0+` +
|
||||
`+1+`
|
||||
>> `+test != test+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+test != string+` +
|
||||
== `+1+`
|
||||
|
||||
| `+<=+` | |
|
||||
以下 |
|
||||
`+abc <= defghi+` +
|
||||
`+abc <= abc+` +
|
||||
`+defghi <= abc+` +
|
||||
`+15 <= 2+` |
|
||||
`+1+` +
|
||||
`+1+` +
|
||||
`+0+` +
|
||||
`+0+`
|
||||
>> `+abc <= defghi+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+abc <= abc+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+defghi <= abc+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+15 <= 2+` +
|
||||
== `+0+`
|
||||
|
||||
| `+<+` | |
|
||||
より小さい |
|
||||
`+abc < defghi+` +
|
||||
`+abc < abc+` +
|
||||
`+defghi < abc+` +
|
||||
`+15 < 2+` |
|
||||
`+1+` +
|
||||
`+0+` +
|
||||
`+0+` +
|
||||
`+0+`
|
||||
>> `+abc < defghi+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+abc < abc+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+defghi < abc+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+15 < 2+` +
|
||||
== `+0+`
|
||||
|
||||
| `+>=+` | |
|
||||
以上 |
|
||||
`+defghi >= abc+` +
|
||||
`+abc >= abc+` +
|
||||
`+abc >= defghi+` +
|
||||
`+15 >= 2+` |
|
||||
`+1+` +
|
||||
`+1+` +
|
||||
`+0+` +
|
||||
`+1+`
|
||||
>> `+defghi >= abc+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+abc >= abc+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+abc >= defghi+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+15 >= 2+` +
|
||||
== `+1+`
|
||||
|
||||
| `+>+` | |
|
||||
より大きい |
|
||||
`+defghi > abc+` +
|
||||
`+abc > abc+` +
|
||||
`+abc > defghi+` +
|
||||
`+15 > 2+` |
|
||||
`+1+` +
|
||||
`+0+` +
|
||||
`+0+` +
|
||||
`+1+`
|
||||
>> `+defghi > abc+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+abc > abc+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+abc > defghi+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+15 > 2+` +
|
||||
== `+1+`
|
||||
|===
|
||||
|
||||
浮動小数点数として比較される数値表現の書式は以下です:
|
||||
@@ -2592,125 +2618,142 @@ str5 = weechat.string_eval_expression("password=abc password=def", {}, {}, optio
|
||||
式中で展開される変数のリスト
|
||||
(優先度の高い順、展開順の早いものを上に遅いものを下に):
|
||||
|
||||
[width="100%",cols="2,1,8,4,4",options="header"]
|
||||
[width="100%",cols="2,1,5,5",options="header"]
|
||||
|===
|
||||
// TRANSLATION MISSING
|
||||
| 書式 | Min WeeChat | 説明 | 例 | 結果
|
||||
| 書式 | Min WeeChat | 説明 | 例
|
||||
|
||||
// TRANSLATION MISSING
|
||||
| `+${raw:xxx}+` | 3.1 |
|
||||
Raw string (not evaluated). |
|
||||
`+${raw:${info:version}}+` |
|
||||
`+${info:version}+`
|
||||
>> `+${raw:${info:version}}+` +
|
||||
== `+${info:version}+`
|
||||
|
||||
// TRANSLATION MISSING
|
||||
| `+${name}+` | 3.4 |
|
||||
User variable (defined with `+${define:name,value}+`). |
|
||||
`+${name}+` |
|
||||
`+value+`
|
||||
>> `+${name}+` +
|
||||
== `+value+`
|
||||
|
||||
| `+${name}+` | |
|
||||
_extra_vars_ の変数 `name` の値に展開 |
|
||||
`+${name}+` |
|
||||
`+value+`
|
||||
>> `+${name}+` +
|
||||
== `+value+`
|
||||
|
||||
// TRANSLATION MISSING
|
||||
| `+${weechat_xxx_dir}+` | 3.2 |
|
||||
A WeeChat directory: `+${weechat_config_dir}+`, `+${weechat_data_dir}+`,
|
||||
`+${weechat_cache_dir}+` or `+${weechat_runtime_dir}+`. |
|
||||
`+${weechat_config_dir}+` +
|
||||
`+${weechat_data_dir}+` +
|
||||
`+${weechat_cache_dir}+` +
|
||||
`+${weechat_runtime_dir}+` |
|
||||
`+/home/user/.config/weechat+` +
|
||||
`+/home/user/.local/share/weechat+` +
|
||||
`+/home/user/.cache/weechat+` +
|
||||
`+/run/user/1000/weechat+`
|
||||
>> `+${weechat_config_dir}+` +
|
||||
== `+/home/user/.config/weechat+` +
|
||||
+
|
||||
>> `+${weechat_data_dir}+` +
|
||||
== `+/home/user/.local/share/weechat+` +
|
||||
+
|
||||
>> `+${weechat_cache_dir}+` +
|
||||
== `+/home/user/.cache/weechat+` +
|
||||
+
|
||||
>> `+${weechat_runtime_dir}+` +
|
||||
== `+/run/user/1000/weechat+`
|
||||
|
||||
| `+${eval:xxx}+` | 1.3 |
|
||||
評価する文字列 |
|
||||
`+${eval:${date:${weechat.look.buffer_time_format}}}+` |
|
||||
`+19:02:45+` (オプション weechat.look.buffer_time_format
|
||||
内に色コードが存在する場合色付き)
|
||||
>> `+${eval:${date:${weechat.look.buffer_time_format}}}+` +
|
||||
== `+19:02:45+` ^(1)^ +
|
||||
+
|
||||
^(1)^ オプション weechat.look.buffer_time_format 内に色コードが存在する場合色付き
|
||||
|
||||
// TRANSLATION MISSING
|
||||
| `+${eval_cond:xxx}+` | 3.1 |
|
||||
String to evaluate as condition. |
|
||||
`+${eval_cond:${window.win_width} > 100}+` |
|
||||
`+1+`
|
||||
>> `+${eval_cond:${window.win_width} > 100}+` +
|
||||
== `+1+`
|
||||
|
||||
| `+${esc:xxx}+` +
|
||||
`+${\xxx}+` | 1.0 |
|
||||
エスケープ文字を含む文字列 |
|
||||
`+${esc:prefix\tmessage}+` +
|
||||
`+${\ua9}+` |
|
||||
`+prefix<TAB>message+` +
|
||||
`+©+`
|
||||
>> `+${esc:prefix\tmessage}+` +
|
||||
== `+prefix<TAB>message+` +
|
||||
+
|
||||
>> `+${\ua9}+` +
|
||||
== `+©+`
|
||||
|
||||
| `+${hide:x,string}+` | 1.1 |
|
||||
隠す文字を含むテキスト (`string` に含まれる文字をすべて `x` で置換) |
|
||||
`+${hide:*,password}+` |
|
||||
`+********+`
|
||||
>> `+${hide:*,password}+` +
|
||||
== `+********+`
|
||||
|
||||
| `+${cut:max,suffix,string}+` +
|
||||
`+${cut:+max,suffix,string}+` | 1.8 |
|
||||
`string` の先頭 `max` 文字とオプションの `suffix` 文字 (`string` の文字数が `max` 文字を超える場合) +
|
||||
`+max` を使った場合、`max` 文字にはサフィックスの文字数も含まれます。|
|
||||
`+${cut:4,…,this is a test}+` +
|
||||
`+${cut:+4,…,this is a test}+` +
|
||||
`+${cut:2,>>,こんにちは世界}+` |
|
||||
`+this…+` +
|
||||
`+t…+` +
|
||||
`+こん>>+`
|
||||
>> `+${cut:4,…,this is a test}+` +
|
||||
== `+this…+` +
|
||||
+
|
||||
>> `+${cut:+4,…,this is a test}+` +
|
||||
== `+t…+` +
|
||||
+
|
||||
>> `+${cut:2,>>,こんにちは世界}+` +
|
||||
== `+こん>>+`
|
||||
|
||||
| `+${cutscr:max,suffix,string}+` +
|
||||
`+${cutscr:+max,suffix,string}+` | 1.8 |
|
||||
`string` の先頭 `max` 文字 (半角文字幅換算) とオプションの `suffix` 文字 (`string` の文字数が `max` 文字を超える場合) +
|
||||
`+max` を使った場合、`max` 文字にはサフィックスの文字数も含まれます。|
|
||||
`+${cutscr:4,…,this is a test}+` +
|
||||
`+${cutscr:+4,…,this is a test}+` +
|
||||
`+${cutscr:2,>>,こんにちは世界}+` |
|
||||
`+this…+` +
|
||||
`+thi…+` +
|
||||
`+こ>>+`
|
||||
>> `+${cutscr:4,…,this is a test}+` +
|
||||
== `+this…+` +
|
||||
+
|
||||
>> `+${cutscr:+4,…,this is a test}+` +
|
||||
== `+thi…+` +
|
||||
+
|
||||
>> `+${cutscr:2,>>,こんにちは世界}+` +
|
||||
== `+こ>>+`
|
||||
|
||||
// TRANSLATION MISSING
|
||||
| `+${rev:xxx}+` | 2.2 |
|
||||
Reversed string (color codes are reversed, so the string should not contain
|
||||
color codes). |
|
||||
`+${rev:Hello, world!}+` +
|
||||
`+${rev:Hello, ${color:red}world!}+` |
|
||||
`+!dlrow ,olleH+` +
|
||||
`+!dlrow30F ,olleH+` (no color, the color code is reversed)
|
||||
>> `+${rev:Hello, world!}+` +
|
||||
== `+!dlrow ,olleH+` +
|
||||
+
|
||||
>> `+${rev:Hello, ${color:red}world!}+` +
|
||||
== `+!dlrow30F ,olleH+` ^(1)^ +
|
||||
+
|
||||
^(1)^ No color, the color code is reversed
|
||||
|
||||
// TRANSLATION MISSING
|
||||
| `+${revscr:xxx}+` | 2.7 |
|
||||
Reversed string for screen, color codes are not reversed. |
|
||||
`+${revscr:Hello, world!}+` +
|
||||
`+${revscr:Hello, ${color:red}world!}+` |
|
||||
`+!dlrow ,olleH+` +
|
||||
`+!dlrow ,olleH+` (`pass:[ ,olleH]` in red)
|
||||
>> `+${revscr:Hello, world!}+` +
|
||||
== `+!dlrow ,olleH+` +
|
||||
+
|
||||
>> `+${revscr:Hello, ${color:red}world!}+` +
|
||||
== `+!dlrow ,olleH+` ^(1)^ +
|
||||
+
|
||||
^(1)^ `pass:[ ,olleH]` in red
|
||||
|
||||
| `+${repeat:count,string}+` | 2.3 |
|
||||
繰り返し文字列。|
|
||||
`+${repeat:5,-}+` |
|
||||
`+-----+`
|
||||
>> `+${repeat:5,-}+` +
|
||||
== `+-----+`
|
||||
|
||||
// TRANSLATION MISSING
|
||||
| `+${length:xxx}+` | 2.7 |
|
||||
Length of string (number of UTF-8 chars), color codes are ignored. |
|
||||
`+${length:test}+` +
|
||||
`+${length:こんにちは世界}+` |
|
||||
`+4+` +
|
||||
`+7+`
|
||||
>> `+${length:test}+` +
|
||||
== `+4+` +
|
||||
+
|
||||
>> `+${length:こんにちは世界}+` +
|
||||
== `+7+`
|
||||
|
||||
// TRANSLATION MISSING
|
||||
| `+${lengthscr:xxx}+` | 2.7 |
|
||||
Length of string displayed on screen, color codes are ignored. |
|
||||
`+${lengthscr:test}+` +
|
||||
`+${lengthscr:こんにちは世界}+` |
|
||||
`+4+` +
|
||||
`+14+`
|
||||
>> `+${lengthscr:test}+` +
|
||||
== `+4+` +
|
||||
+
|
||||
>> `+${lengthscr:こんにちは世界}+` +
|
||||
== `+14+`
|
||||
|
||||
// TRANSLATION MISSING
|
||||
| `+${split:number,seps,flags,xxx}+` | 3.3 |
|
||||
@@ -2727,24 +2770,32 @@ str5 = weechat.string_eval_expression("password=abc password=def", {}, {}, optio
|
||||
- `keep_eol`: keep end of line for each value +
|
||||
- `strip_items=xyz`: strip chars `x`, `y` and `z` from beginning/end of items +
|
||||
- `max_items=N`: return max N items |
|
||||
`+${split:1,,,abc,def,ghi}+` +
|
||||
`+${split:-1,,,abc,def,ghi}+` +
|
||||
`+${split:count,,,abc,def,ghi}+` +
|
||||
`+${split:random,,,abc,def,ghi}+` +
|
||||
`+${split:3,,collapse_seps,abc,,,def,,,ghi}+` +
|
||||
`+${split:3,,strip_items=-_,_-abc-_,_-def-_,_-ghi-_}+` +
|
||||
`+${split:2, ,,this is a test}+` +
|
||||
`+${split:2, ,strip_left+strip_right, this is a test }+` +
|
||||
`+${split:2, ,keep_eol,this is a test}+` |
|
||||
`+abc+` +
|
||||
`+ghi+` +
|
||||
`+3+` +
|
||||
`+def+` +
|
||||
`+ghi+` +
|
||||
`+ghi+` +
|
||||
`+is+` +
|
||||
`+is+` +
|
||||
`+is a test+`
|
||||
>> `+${split:1,,,abc,def,ghi}+` +
|
||||
== `+abc+` +
|
||||
+
|
||||
>> `+${split:-1,,,abc,def,ghi}+` +
|
||||
== `+ghi+` +
|
||||
+
|
||||
>> `+${split:count,,,abc,def,ghi}+` +
|
||||
== `+3+` +
|
||||
+
|
||||
>> `+${split:random,,,abc,def,ghi}+` +
|
||||
== `+def+` +
|
||||
+
|
||||
>> `+${split:3,,collapse_seps,abc,,,def,,,ghi}+` +
|
||||
== `+ghi+` +
|
||||
+
|
||||
>> `+${split:3,,strip_items=-_,_-abc-_,_-def-_,_-ghi-_}+` +
|
||||
== `+ghi+` +
|
||||
+
|
||||
>> `+${split:2, ,,this is a test}+` +
|
||||
== `+is+` +
|
||||
+
|
||||
>> `+${split:2, ,strip_left+strip_right, this is a test }+` +
|
||||
== `+is+` +
|
||||
+
|
||||
>> `+${split:2, ,keep_eol,this is a test}+` +
|
||||
== `+is a test+`
|
||||
|
||||
// TRANSLATION MISSING
|
||||
| `+${split_shell:number,xxx}+` | 3.3 |
|
||||
@@ -2753,14 +2804,17 @@ str5 = weechat.string_eval_expression("password=abc password=def", {}, {}, optio
|
||||
- `random`: a random argument +
|
||||
- integer ≥ 1: the argument by index (1 = first argument) +
|
||||
- integer ≤ -1: the argument by index from the end (-1 = last argument, -2 = penultimate argument, etc.) |
|
||||
`+${split_shell:1,"first arg" arg2}+` +
|
||||
`+${split_shell:-1,"first arg" arg2}+` +
|
||||
`+${split_shell:count,"first arg" arg2}+` +
|
||||
`+${split_shell:random,"first arg" arg2}+` |
|
||||
`+first arg+` +
|
||||
`+arg2+` +
|
||||
`+2+` +
|
||||
`+arg2+`
|
||||
>> `+${split_shell:1,"first arg" arg2}+` +
|
||||
== `+first arg+` +
|
||||
+
|
||||
>> `+${split_shell:-1,"first arg" arg2}+` +
|
||||
== `+arg2+` +
|
||||
+
|
||||
>> `+${split_shell:count,"first arg" arg2}+` +
|
||||
== `+2+` +
|
||||
+
|
||||
>> `+${split_shell:random,"first arg" arg2}+` +
|
||||
== `+arg2+`
|
||||
|
||||
// TRANSLATION MISSING
|
||||
| `+${re:xxx}+` | 1.1 |
|
||||
@@ -2770,78 +2824,94 @@ str5 = weechat.string_eval_expression("password=abc password=def", {}, {}, optio
|
||||
`+++` = last group captured, +
|
||||
`#` = index of last group captured _(WeeChat ≥ 1.8)_, +
|
||||
`repl_index` = index of replacement being done (starts to 1) _(WeeChat ≥ 3.3)_. |
|
||||
`+${re:0}+` +
|
||||
`+${re:1}+` +
|
||||
`+${re:2}+` +
|
||||
`+${re:+}+` +
|
||||
`+${re:#}+` +
|
||||
`+${re:repl_index}+` |
|
||||
`+test1 test2+` +
|
||||
`+test1+` +
|
||||
`+test2+` +
|
||||
`+test2+` +
|
||||
`+2+` +
|
||||
`+1+`
|
||||
>> `+${re:0}+` +
|
||||
== `+test1 test2+` +
|
||||
+
|
||||
>> `+${re:1}+` +
|
||||
== `+test1+` +
|
||||
+
|
||||
>> `+${re:2}+` +
|
||||
== `+test2+` +
|
||||
+
|
||||
>> `+${re:+}+` +
|
||||
== `+test2+` +
|
||||
+
|
||||
>> `+${re:#}+` +
|
||||
== `+2+` +
|
||||
+
|
||||
>> `+${re:repl_index}+` +
|
||||
== `+1+`
|
||||
|
||||
| `+${color:name}+` | 0.4.2 |
|
||||
WeeChat 色コード (色名部分はオプション属性をとることも可能です),
|
||||
書式を確認するには関数 <<_color,color>> をご確認ください |
|
||||
`+${color:red}red text+` +
|
||||
`+${color:*214}bold orange text+` |
|
||||
`+red text+` (赤色で) +
|
||||
`+bold orange text+` (太字オレンジ色で)
|
||||
>> `+${color:red}red text+` +
|
||||
== `+red text+` ^(1)^ +
|
||||
+
|
||||
>> `+${color:*214}bold orange text+` +
|
||||
== `+bold orange text+` ^(2)^ +
|
||||
+
|
||||
^(1)^ 赤色で +
|
||||
^(2)^ 太字オレンジ色で
|
||||
|
||||
// TRANSLATION MISSING
|
||||
| `+${modifier:name,data,string}+` | 2.7 |
|
||||
Result of a modifier, see function
|
||||
<<_hook_modifier_exec,hook_modifier_exec>>. |
|
||||
`+${modifier:eval_path_home,,~}+` +
|
||||
`+${modifier:eval_path_home,directory=config,%h/weechat.conf}+` |
|
||||
`+/home/user+` +
|
||||
`+/home/user/.config/weechat/weechat.conf+`
|
||||
>> `+${modifier:eval_path_home,,~}+` +
|
||||
== `+/home/user+` +
|
||||
+
|
||||
>> `+${modifier:eval_path_home,directory=config,%h/irc.conf}+` +
|
||||
== `+/home/user/.config/weechat/irc.conf+`
|
||||
|
||||
| `+${info:name}+` +
|
||||
`+${info:name,arguments}+` | 0.4.3 |
|
||||
WeeChat またはプラグインのインフォ、<<_info_get,info_get>>
|
||||
を参照 |
|
||||
`+${info:version}+` +
|
||||
`+${info:nick_color_name,foo}+` |
|
||||
`+1.0+` +
|
||||
`+lightblue+`
|
||||
>> `+${info:version}+` +
|
||||
== `+1.0+` +
|
||||
+
|
||||
>> `+${info:nick_color_name,foo}+` +
|
||||
== `+lightblue+`
|
||||
|
||||
// TRANSLATION MISSING
|
||||
| `+${base_encode:base,xxx}+` | 2.9 |
|
||||
String encoded in base 16, 32 or 64. |
|
||||
`+${base_encode:16,test string}+` +
|
||||
`+${base_encode:32,test string}+` +
|
||||
`+${base_encode:64,test string}+` |
|
||||
`+7465737420737472696E67+` +
|
||||
`+ORSXG5BAON2HE2LOM4======+` +
|
||||
`+dGVzdCBzdHJpbmc=+`
|
||||
>> `+${base_encode:16,test string}+` +
|
||||
== `+7465737420737472696E67+` +
|
||||
+
|
||||
>> `+${base_encode:32,test string}+` +
|
||||
== `+ORSXG5BAON2HE2LOM4======+` +
|
||||
+
|
||||
>> `+${base_encode:64,test string}+` +
|
||||
== `+dGVzdCBzdHJpbmc=+`
|
||||
|
||||
// TRANSLATION MISSING
|
||||
| `+${base_decode:base,xxx}+` | 2.9 |
|
||||
String decoded from base 16, 32 or 64. |
|
||||
`+${base_decode:16,7465737420737472696E67}+` +
|
||||
`+${base_decode:32,ORSXG5BAON2HE2LOM4======}+` +
|
||||
`+${base_decode:64,dGVzdCBzdHJpbmc=}+` |
|
||||
`+test string+` +
|
||||
`+test string+` +
|
||||
`+test string+`
|
||||
>> `+${base_decode:16,7465737420737472696E67}+` +
|
||||
== `+test string+` +
|
||||
+
|
||||
>> `+${base_decode:32,ORSXG5BAON2HE2LOM4======}+` +
|
||||
== `+test string+` +
|
||||
+
|
||||
>> `+${base_decode:64,dGVzdCBzdHJpbmc=}+` +
|
||||
== `+test string+`
|
||||
|
||||
| `+${date}+` +
|
||||
`+${date:xxx}+` | 1.3 |
|
||||
現在の日付/時刻、カスタム書式を使うことも可能です (`man strftime` を参照)、
|
||||
デフォルト書式は `%F %T` |
|
||||
`+${date}+` +
|
||||
`+${date:%H:%M:%S}+` |
|
||||
`+2015-06-30 19:02:45+` +
|
||||
`+19:02:45+`
|
||||
>> `+${date}+` +
|
||||
== `+2015-06-30 19:02:45+` +
|
||||
+
|
||||
>> `+${date:%H:%M:%S}+` +
|
||||
== `+19:02:45+`
|
||||
|
||||
| `+${env:NAME}+` | 1.2 |
|
||||
環境変数 `NAME` の値 |
|
||||
`+${env:HOME}+` |
|
||||
`+/home/user+`
|
||||
>> `+${env:HOME}+` +
|
||||
== `+/home/user+`
|
||||
|
||||
| `+${if:condition}+` +
|
||||
`+${if:condition?true}+`
|
||||
@@ -2849,8 +2919,8 @@ str5 = weechat.string_eval_expression("password=abc password=def", {}, {}, optio
|
||||
条件、条件が真の場合の値 (任意)、条件が偽の場合の値 (任意)
|
||||
からなる三項演算子。値を指定しなかった場合、条件の評価結果に応じて
|
||||
"1" または "0" が返されます |
|
||||
`+${if:${info:term_width}>80?big:small}+` |
|
||||
`+big+`
|
||||
>> `+${if:${info:term_width}>80?big:small}+` +
|
||||
== `+big+`
|
||||
|
||||
// TRANSLATION MISSING
|
||||
| `+${calc:xxx}+` | 2.7 |
|
||||
@@ -2863,57 +2933,64 @@ str5 = weechat.string_eval_expression("password=abc password=def", {}, {}, optio
|
||||
`+//+`: result of division without fractional part +
|
||||
`+%+`: remainder of division +
|
||||
`+**+`: power. |
|
||||
`+${calc:5+2*3}+` +
|
||||
`+${calc:(5+2)*3}+` +
|
||||
`+${calc:10/4}+` +
|
||||
`+${calc:10//4}+` +
|
||||
`+${calc:9.2%3}+` +
|
||||
`+${calc:2**16}+` |
|
||||
`+11+` +
|
||||
`+21+` +
|
||||
`+2.5+` +
|
||||
`+2+` +
|
||||
`+0.2+` +
|
||||
`+65536+`
|
||||
>> `+${calc:5+2*3}+` +
|
||||
== `+11+` +
|
||||
+
|
||||
>> `+${calc:(5+2)*3}+` +
|
||||
== `+21+` +
|
||||
+
|
||||
>> `+${calc:10/4}+` +
|
||||
== `+2.5+` +
|
||||
+
|
||||
>> `+${calc:10//4}+` +
|
||||
== `+2+` +
|
||||
+
|
||||
>> `+${calc:9.2%3}+` +
|
||||
== `+0.2+` +
|
||||
+
|
||||
>> `+${calc:2**16}+` +
|
||||
== `+65536+`
|
||||
|
||||
// TRANSLATION MISSING
|
||||
| `+${random:min,max}+` | 3.3 |
|
||||
Random integer number in the range from `min` to `max` (inclusive). |
|
||||
`+${random:0,10}+` |
|
||||
`+3+`
|
||||
>> `+${random:0,10}+` +
|
||||
== `+3+`
|
||||
|
||||
// TRANSLATION MISSING
|
||||
| `+${translate:xxx}+` | 3.2 |
|
||||
Translated string (depends on the language used by WeeChat to display messages). |
|
||||
`+${translate:Plugin}+` |
|
||||
`+Extension+` (example in French)
|
||||
>> `+${translate:Plugin}+` +
|
||||
== `+Extension+` ^(1)^ +
|
||||
+
|
||||
^(1)^ Example in French
|
||||
|
||||
// TRANSLATION MISSING
|
||||
| `+${define:name,value}+` | 3.4 |
|
||||
Define a variable `name` set to `value`, which can then be used in the same
|
||||
evaluated expression with `+${name}+`. |
|
||||
`+${define:len,${calc:5+3}}${len}x${len}+` |
|
||||
`+8x8+`
|
||||
>> `+${define:len,${calc:5+3}}${len}x${len}+` +
|
||||
== `+8x8+`
|
||||
|
||||
| `+${sec.data.name}+` | |
|
||||
セキュアデータ `name` の値 |
|
||||
`+${sec.data.libera_pass}+` |
|
||||
`+my_password+`
|
||||
>> `+${sec.data.libera_pass}+` +
|
||||
== `+my_password+`
|
||||
|
||||
| `+${file.section.option}+` | |
|
||||
オプションの値 |
|
||||
`+${weechat.look.buffer_time_format}+` |
|
||||
`+%H:%M:%S+`
|
||||
>> `+${weechat.look.buffer_time_format}+` +
|
||||
== `+%H:%M:%S+`
|
||||
|
||||
| `+${name}+` | |
|
||||
バッファに対するローカル変数 `name` の値 |
|
||||
`+${nick}+` |
|
||||
`+FlashCode+`
|
||||
>> `+${nick}+` +
|
||||
== `+FlashCode+`
|
||||
|
||||
| `+${pointer}+` | |
|
||||
_pointers_ の変数 `pointer` の値に展開 |
|
||||
`+${buffer}+` |
|
||||
`+0x1234abcd+`
|
||||
>> `+${buffer}+` +
|
||||
== `+0x1234abcd+`
|
||||
|
||||
// TRANSLATION MISSING
|
||||
| `+${hdata.var1.var2...}+` +
|
||||
@@ -2922,11 +2999,14 @@ str5 = weechat.string_eval_expression("password=abc password=def", {}, {}, optio
|
||||
ポインタはデフォルトで現在のウィンドウ/バッファに設定されます),
|
||||
`list` can be a list name (example: "gui_buffers"), a pointer
|
||||
(example: "0x1234abcd") or a pointer name (example: "my_pointer"). |
|
||||
`+${buffer[gui_buffers].full_name}+` +
|
||||
`+${buffer[my_buffer_pointer].full_name}+` +
|
||||
`+${window.buffer.number}+` |
|
||||
`+core.weechat+` +
|
||||
`+1+`
|
||||
>> `+${buffer[gui_buffers].full_name}+` +
|
||||
== `+core.weechat+` +
|
||||
+
|
||||
>> `+${buffer[my_buffer_pointer].full_name}+` +
|
||||
== `+core.weechat+` +
|
||||
+
|
||||
>> `+${window.buffer.number}+` +
|
||||
== `+1+`
|
||||
|===
|
||||
|
||||
==== string_dyn_alloc
|
||||
|
||||
+330
-250
@@ -2272,158 +2272,184 @@ str5 = weechat.string_eval_expression("password=abc password=def", {}, {}, optio
|
||||
|
||||
Листа логичких оператора који могу да се користе у условима (по редоследу приоритета, од првог до последњег):
|
||||
|
||||
[width="100%", cols="2,1,8,4,4", options="header"]
|
||||
[width="100%", cols="2,1,5,5", options="header"]
|
||||
|===
|
||||
| Оператор | Мин WeeChat | Опис | Примери | Резултати
|
||||
| Оператор | Мин WeeChat | Опис | Примери
|
||||
|
||||
| `+&&+` | |
|
||||
Логичко „и” |
|
||||
`+25 && 77+` +
|
||||
`+25 && 0+` |
|
||||
`+1+` +
|
||||
`+0+`
|
||||
>> `+25 && 77+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+25 && 0+` +
|
||||
== `+0+`
|
||||
|
||||
| `+\|\|+` | |
|
||||
Логичко „или” |
|
||||
`+25 \|\| 0+` +
|
||||
`+0 \|\| 0+` |
|
||||
`+1+` +
|
||||
`+0+`
|
||||
>> `+25 \|\| 0+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+0 \|\| 0+` +
|
||||
== `+0+`
|
||||
|===
|
||||
|
||||
Листа оператора поређења који могу да се користе у условима (према редоследу приоритета, од првог до последњег):
|
||||
|
||||
[width="100%", cols="2,1,8,4,4", options="header"]
|
||||
[width="100%", cols="2,1,5,5", options="header"]
|
||||
|===
|
||||
| Оператор | Мин WeeChat | Опис | Примери | Резултат
|
||||
| Оператор | Мин WeeChat | Опис | Примери
|
||||
|
||||
| `+=~+` | |
|
||||
Подудара се са POSIX проширеним регуларним изразом (дозвољене су необавезне заставице, погледајте функцију <<_string_regcomp,string_regcomp>>) |
|
||||
`+abc def =~ ab.*ef+` +
|
||||
`+abc def =~ y.*z+` |
|
||||
`+1+` +
|
||||
`+0+`
|
||||
>> `+abc def =~ ab.*ef+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+abc def =~ y.*z+` +
|
||||
== `+0+`
|
||||
|
||||
| `+!~+` | |
|
||||
НЕ подудара се са POSIX проширеним регуларним изразом (дозвољене су необавезне заставице, погледајте функцију <<_string_regcomp,string_regcomp>>) |
|
||||
`+abc def !~ ab.*ef+` +
|
||||
`+abc def !~ y.*z+` |
|
||||
`+0+` +
|
||||
`+1+`
|
||||
>> `+abc def !~ ab.*ef+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+abc def !~ y.*z+` +
|
||||
== `+1+`
|
||||
|
||||
| `+==*+` | 2.9 |
|
||||
Подудара се са маском где је дозвољено „*”, разликује величину слова (погледајте функцију <<_string_match,string_match>>) |
|
||||
`+abc def ==* a*f+` +
|
||||
`+abc def ==* y*z+` |
|
||||
`+1+` +
|
||||
`+0+`
|
||||
>> `+abc def ==* a*f+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+abc def ==* y*z+` +
|
||||
== `+0+`
|
||||
|
||||
| `+!!*+` | 2.9 |
|
||||
НИЈЕ џокер маска у којој је дозвољено „*”, разликује величину слова (погледајте функцију <<_string_match,string_match>>) |
|
||||
`+abc def !!* a*f+` +
|
||||
`+abc def !!* y*z+` |
|
||||
`+0+` +
|
||||
`+1+`
|
||||
>> `+abc def !!* a*f+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+abc def !!* y*z+` +
|
||||
== `+1+`
|
||||
|
||||
| `+=*+` | 1.8 |
|
||||
Подудара се са маском где је дозвољено „*”, не разликује величину слова (погледајте функцију <<_string_match,string_match>>) |
|
||||
`+abc def =* A*F+` +
|
||||
`+abc def =* Y*Z+` |
|
||||
`+1+` +
|
||||
`+0+`
|
||||
>> `+abc def =* A*F+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+abc def =* Y*Z+` +
|
||||
== `+0+`
|
||||
|
||||
| `+!*+` | 1.8 |
|
||||
НИЈЕ џокер маска у којој је дозвољено „*”, не разликује величину слова (погледајте функцију <<_string_match,string_match>>) |
|
||||
`+abc def !* A*F+` +
|
||||
`+abc def !* Y*Z+` |
|
||||
`+0+` +
|
||||
`+1+`
|
||||
>> `+abc def !* A*F+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+abc def !* Y*Z+` +
|
||||
== `+1+`
|
||||
|
||||
| `+==-+` | 2.9 |
|
||||
Је укључено, разликује величину слова |
|
||||
`+abc def ==- bc+` +
|
||||
`+abc def ==- xyz+` |
|
||||
`+1+` +
|
||||
`+0+`
|
||||
>> `+abc def ==- bc+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+abc def ==- xyz+` +
|
||||
== `+0+`
|
||||
|
||||
| `+!!-+` | 2.9 |
|
||||
НИЈЕ укључено, разликује величину слова |
|
||||
`+abc def !!- bc+` +
|
||||
`+abc def !!- xyz+` |
|
||||
`+0+` +
|
||||
`+1+`
|
||||
>> `+abc def !!- bc+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+abc def !!- xyz+` +
|
||||
== `+1+`
|
||||
|
||||
| `+=-+` | 2.9 |
|
||||
Је укључено, не разликује величину слова |
|
||||
`+abc def =- BC+` +
|
||||
`+abc def =- XYZ+` |
|
||||
`+1+` +
|
||||
`+0+`
|
||||
>> `+abc def =- BC+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+abc def =- XYZ+` +
|
||||
== `+0+`
|
||||
|
||||
| `+!-+` | 2.9 |
|
||||
НИЈЕ укључено, не разликује величину слова |
|
||||
`+abc def !- BC+` +
|
||||
`+abc def !- XYZ+` |
|
||||
`+0+` +
|
||||
`+1+`
|
||||
>> `+abc def !- BC+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+abc def !- XYZ+` +
|
||||
== `+1+`
|
||||
|
||||
| `+==+` | |
|
||||
Једнако |
|
||||
`+test == test+` +
|
||||
`+test == string+` |
|
||||
`+1+` +
|
||||
`+0+`
|
||||
>> `+test == test+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+test == string+` +
|
||||
== `+0+`
|
||||
|
||||
| `+!=+` | |
|
||||
Није једнако |
|
||||
`+test != test+` +
|
||||
`+test != string+` |
|
||||
`+0+` +
|
||||
`+1+`
|
||||
>> `+test != test+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+test != string+` +
|
||||
== `+1+`
|
||||
|
||||
| `+<=+` | |
|
||||
Мање или једнако |
|
||||
`+abc <= defghi+` +
|
||||
`+abc <= abc+` +
|
||||
`+defghi <= abc+` +
|
||||
`+15 <= 2+` |
|
||||
`+1+` +
|
||||
`+1+` +
|
||||
`+0+` +
|
||||
`+0+`
|
||||
>> `+abc <= defghi+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+abc <= abc+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+defghi <= abc+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+15 <= 2+` +
|
||||
== `+0+`
|
||||
|
||||
| `+<+` | |
|
||||
Мање |
|
||||
`+abc < defghi+` +
|
||||
`+abc < abc+` +
|
||||
`+defghi < abc+` +
|
||||
`+15 < 2+` |
|
||||
`+1+` +
|
||||
`+0+` +
|
||||
`+0+` +
|
||||
`+0+`
|
||||
>> `+abc < defghi+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+abc < abc+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+defghi < abc+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+15 < 2+` +
|
||||
== `+0+`
|
||||
|
||||
| `+>=+` | |
|
||||
Веће или једнако |
|
||||
`+defghi >= abc+` +
|
||||
`+abc >= abc+` +
|
||||
`+abc >= defghi+` +
|
||||
`+15 >= 2+` |
|
||||
`+1+` +
|
||||
`+1+` +
|
||||
`+0+` +
|
||||
`+1+`
|
||||
>> `+defghi >= abc+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+abc >= abc+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+abc >= defghi+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+15 >= 2+` +
|
||||
== `+1+`
|
||||
|
||||
| `+>+` | |
|
||||
Веће |
|
||||
`+defghi > abc+` +
|
||||
`+abc > abc+` +
|
||||
`+abc > defghi+` +
|
||||
`+15 > 2+` |
|
||||
`+1+` +
|
||||
`+0+` +
|
||||
`+0+` +
|
||||
`+1+`
|
||||
>> `+defghi > abc+` +
|
||||
== `+1+` +
|
||||
+
|
||||
>> `+abc > abc+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+abc > defghi+` +
|
||||
== `+0+` +
|
||||
+
|
||||
>> `+15 > 2+` +
|
||||
== `+1+`
|
||||
|===
|
||||
|
||||
У случају да су два израза важећи бројеви, поређење се врши употребом бројева у покретном зарезу, у једном од следећих формата:
|
||||
@@ -2442,116 +2468,133 @@ str5 = weechat.string_eval_expression("password=abc password=def", {}, {}, optio
|
||||
|
||||
Листа развијених променљивих у изразу (према редоследу приоритета, од прве развијене, до последње):
|
||||
|
||||
[width="100%", cols="2,1,8,4,4", options="header"]
|
||||
[width="100%", cols="2,1,5,5", options="header"]
|
||||
|===
|
||||
| Формат | Мин WeeChat | Опис | Примери | Резултати
|
||||
| Формат | Мин WeeChat | Опис | Примери
|
||||
|
||||
| `+${raw:xxx}+` | 3.1 |
|
||||
Сирови стринг (не израчунава се). |
|
||||
`+${raw:${info:version}}+` |
|
||||
`+${info:version}+`
|
||||
>> `+${raw:${info:version}}+` +
|
||||
== `+${info:version}+`
|
||||
|
||||
| `+${име}+` | 3.4 |
|
||||
Корисничка променљива (дефинисана са `+${define:име,вредност}+`). |
|
||||
`+${име}+` |
|
||||
`+вредност+`
|
||||
>> `+${име}+` +
|
||||
== `+вредност+`
|
||||
|
||||
| `+${име}+` | |
|
||||
Променљива `name` из хеш табеле _extra_vars_. |
|
||||
`+${име}+` |
|
||||
`+вредност+`
|
||||
>> `+${име}+` +
|
||||
== `+вредност+`
|
||||
|
||||
| `+${weechat_xxx_dir}+` | 3.2 |
|
||||
WeeChat директоријум: `+${weechat_config_dir}+`, `+${weechat_data_dir}+`,
|
||||
`+${weechat_cache_dir}+` или `+${weechat_runtime_dir}+`. |
|
||||
`+${weechat_config_dir}+` +
|
||||
`+${weechat_data_dir}+` +
|
||||
`+${weechat_cache_dir}+` +
|
||||
`+${weechat_runtime_dir}+` |
|
||||
`+/home/user/.config/weechat+` +
|
||||
`+/home/user/.local/share/weechat+` +
|
||||
`+/home/user/.cache/weechat+` +
|
||||
`+/run/user/1000/weechat+`
|
||||
>> `+${weechat_config_dir}+` +
|
||||
== `+/home/user/.config/weechat+` +
|
||||
+
|
||||
>> `+${weechat_data_dir}+` +
|
||||
== `+/home/user/.local/share/weechat+` +
|
||||
+
|
||||
>> `+${weechat_cache_dir}+` +
|
||||
== `+/home/user/.cache/weechat+` +
|
||||
+
|
||||
>> `+${weechat_runtime_dir}+` +
|
||||
== `+/run/user/1000/weechat+`
|
||||
|
||||
| `+${eval:xxx}+` | 1.3 |
|
||||
Стринг који се израчунава. |
|
||||
`+${eval:${date:${weechat.look.buffer_time_format}}}+` |
|
||||
`+19:02:45+` (са бојама, ако у опцији weechat.look.buffer_time_format
|
||||
постоје боје)
|
||||
>> `+${eval:${date:${weechat.look.buffer_time_format}}}+` +
|
||||
== `+19:02:45+` ^(1)^ +
|
||||
+
|
||||
^(1)^ са бојама, ако у опцији weechat.look.buffer_time_format постоје боје
|
||||
|
||||
| `+${eval_cond:xxx}+` | 3.1 |
|
||||
Стринг који се израчунава као услов. |
|
||||
`+${eval_cond:${window.win_width} > 100}+` |
|
||||
`+1+`
|
||||
>> `+${eval_cond:${window.win_width} > 100}+` +
|
||||
== `+1+`
|
||||
|
||||
| `+${esc:xxx}+` +
|
||||
`+${\xxx}+` | 1.0 |
|
||||
Стринг са означеним карактерима. |
|
||||
`+${esc:prefix\tmessage}+` +
|
||||
`+${\ua9}+` |
|
||||
`+prefix<TAB>message+` +
|
||||
`+©+`
|
||||
>> `+${esc:prefix\tmessage}+` +
|
||||
== `+prefix<TAB>message+` +
|
||||
+
|
||||
>> `+${\ua9}+` +
|
||||
== `+©+`
|
||||
|
||||
| `+${hide:x,стринг}+` | 1.1 |
|
||||
Стринг са скривеним карактерима (сви карактери у `стринг` се замењују са `x`). |
|
||||
`+${hide:*,password}+` |
|
||||
`+********+`
|
||||
>> `+${hide:*,password}+` +
|
||||
== `+********+`
|
||||
|
||||
| `+${cut:макс,суфикс,стринг}+` +
|
||||
`+${cut:+макс,суфикс,стринг}+` | 1.8 |
|
||||
Стринг са `макс` карактера и необавезним `суфикс` ако се стринг сече. +
|
||||
У формату `+макс`, суфикс се рачуна у максималну дужину. |
|
||||
`+${cut:4,…,this is a test}+` +
|
||||
`+${cut:+4,…,this is a test}+` +
|
||||
`+${cut:2,>>,こんにちは世界}+` |
|
||||
`+this…+` +
|
||||
`+t…+` +
|
||||
`+こん>>+`
|
||||
>> `+${cut:4,…,this is a test}+` +
|
||||
== `+this…+` +
|
||||
+
|
||||
>> `+${cut:+4,…,this is a test}+` +
|
||||
== `+t…+` +
|
||||
+
|
||||
>> `+${cut:2,>>,こんにちは世界}+` +
|
||||
== `+こん>>+`
|
||||
|
||||
| `+${cutscr:макс,суфикс,стринг}+` +
|
||||
`+${cutscr:+макс,суфикс,стринг}+` | 1.8 |
|
||||
Стринг са `макс` карактера приказаних на екрану, и необавезним `суфикс` ако се стринг сече.
|
||||
У формату `+макс`, суфикс се рачуна у максималну дужину. |
|
||||
`+${cutscr:4,…,this is a test}+` +
|
||||
`+${cutscr:+4,…,this is a test}+` +
|
||||
`+${cutscr:2,>>,こんにちは世界}+` |
|
||||
`+this…+` +
|
||||
`+thi…+` +
|
||||
`+こ>>+`
|
||||
>> `+${cutscr:4,…,this is a test}+` +
|
||||
== `+this…+` +
|
||||
+
|
||||
>> `+${cutscr:+4,…,this is a test}+` +
|
||||
== `+thi…+` +
|
||||
+
|
||||
>> `+${cutscr:2,>>,こんにちは世界}+` +
|
||||
== `+こ>>+`
|
||||
|
||||
| `+${rev:xxx}+` | 2.2 |
|
||||
Обрнути стринг (и кодови боја се обрћу, тако да стринг не би требало да садржи
|
||||
кодове боја). |
|
||||
`+${rev:Hello, world!}+` +
|
||||
`+${rev:Hello, ${color:red}world!}+` |
|
||||
`+!dlrow ,olleH+` +
|
||||
`+!dlrow30F ,olleH+` (нема боје, кôд боје је обрнут)
|
||||
>> `+${rev:Hello, world!}+` +
|
||||
== `+!dlrow ,olleH+` +
|
||||
+
|
||||
>> `+${rev:Hello, ${color:red}world!}+` +
|
||||
== `+!dlrow30F ,olleH+` ^(1)^ +
|
||||
+
|
||||
^(1)^ нема боје, кôд боје је обрнут
|
||||
|
||||
| `+${revscr:xxx}+` | 2.7 |
|
||||
Обрнути стринг за екран, кодови боја се не обрћу. |
|
||||
`+${revscr:Hello, world!}+` +
|
||||
`+${revscr:Hello, ${color:red}world!}+` |
|
||||
`+!dlrow ,olleH+` +
|
||||
`+!dlrow ,olleH+` (`pass:[ ,olleH]` у црвеној боји)
|
||||
>> `+${revscr:Hello, world!}+` +
|
||||
== `+!dlrow ,olleH+` +
|
||||
+
|
||||
>> `+${revscr:Hello, ${color:red}world!}+` +
|
||||
== `+!dlrow ,olleH+` ^(1)^ +
|
||||
+
|
||||
^(1)^ `pass:[ ,olleH]` у црвеној боји
|
||||
|
||||
| `+${repeat:број,стринг}+` | 2.3 |
|
||||
Поновљени стринг. |
|
||||
`+${repeat:5,-}+` |
|
||||
`+-----+`
|
||||
>> `+${repeat:5,-}+` +
|
||||
== `+-----+`
|
||||
|
||||
| `+${length:xxx}+` | 2.7 |
|
||||
Дужина стринга (број UTF-8 карактера), кодови боја се игноришу. |
|
||||
`+${length:test}+` +
|
||||
`+${length:こんにちは世界}+` |
|
||||
`+4+` +
|
||||
`+7+`
|
||||
>> `+${length:test}+` +
|
||||
== `+4+` +
|
||||
+
|
||||
>> `+${length:こんにちは世界}+` +
|
||||
== `+7+`
|
||||
|
||||
| `+${lengthscr:xxx}+` | 2.7 |
|
||||
Дужина стринга приказаног на екрану, кодови боја се игноришу. |
|
||||
`+${lengthscr:test}+` +
|
||||
`+${lengthscr:こんにちは世界}+` |
|
||||
`+4+` +
|
||||
`+14+`
|
||||
>> `+${lengthscr:test}+` +
|
||||
== `+4+` +
|
||||
+
|
||||
>> `+${lengthscr:こんにちは世界}+` +
|
||||
== `+14+`
|
||||
|
||||
| `+${split:number,seps,flags,xxx}+` | 3.3 |
|
||||
Дели стринг и враћа сагласно са `number`: +
|
||||
@@ -2567,24 +2610,32 @@ str5 = weechat.string_eval_expression("password=abc password=def", {}, {}, optio
|
||||
- `keep_eol`: задржава прелом линије за сваку вредност +
|
||||
- `strip_items=xyz`: уклања карактере `x`, `y` и `z` са почетка/краја ставки +
|
||||
- `max_items=N`: враћа максимално N ставки |
|
||||
`+${split:1,,,abc,def,ghi}+` +
|
||||
`+${split:-1,,,abc,def,ghi}+` +
|
||||
`+${split:count,,,abc,def,ghi}+` +
|
||||
`+${split:random,,,abc,def,ghi}+` +
|
||||
`+${split:3,,collapse_seps,abc,,,def,,,ghi}+` +
|
||||
`+${split:3,,strip_items=-_,_-abc-_,_-def-_,_-ghi-_}+` +
|
||||
`+${split:2, ,,this is a test}+` +
|
||||
`+${split:2, ,strip_left+strip_right, this is a test }+` +
|
||||
`+${split:2, ,keep_eol,this is a test}+` |
|
||||
`+abc+` +
|
||||
`+ghi+` +
|
||||
`+3+` +
|
||||
`+def+` +
|
||||
`+ghi+` +
|
||||
`+ghi+` +
|
||||
`+is+` +
|
||||
`+is+` +
|
||||
`+is a test+`
|
||||
>> `+${split:1,,,abc,def,ghi}+` +
|
||||
== `+abc+` +
|
||||
+
|
||||
>> `+${split:-1,,,abc,def,ghi}+` +
|
||||
== `+ghi+` +
|
||||
+
|
||||
>> `+${split:count,,,abc,def,ghi}+` +
|
||||
== `+3+` +
|
||||
+
|
||||
>> `+${split:random,,,abc,def,ghi}+` +
|
||||
== `+def+` +
|
||||
+
|
||||
>> `+${split:3,,collapse_seps,abc,,,def,,,ghi}+` +
|
||||
== `+ghi+` +
|
||||
+
|
||||
>> `+${split:3,,strip_items=-_,_-abc-_,_-def-_,_-ghi-_}+` +
|
||||
== `+ghi+` +
|
||||
+
|
||||
>> `+${split:2, ,,this is a test}+` +
|
||||
== `+is+` +
|
||||
+
|
||||
>> `+${split:2, ,strip_left+strip_right, this is a test }+` +
|
||||
== `+is+` +
|
||||
+
|
||||
>> `+${split:2, ,keep_eol,this is a test}+` +
|
||||
== `+is a test+`
|
||||
|
||||
| `+${split_shell:number,xxx}+` | 3.3 |
|
||||
Дели аргументе љуске и враћа сагласно са `number`: +
|
||||
@@ -2592,14 +2643,17 @@ str5 = weechat.string_eval_expression("password=abc password=def", {}, {}, optio
|
||||
- `random`: произвољни аргумент +
|
||||
- цео број ≥ 1: аргумент по индексу (1 = први аргумент) +
|
||||
- цео број ≤ -1: аргумент по индексу од краја (-1 = последњи аргумент, -2 = претпоследњи аргумент, итд.) |
|
||||
`+${split_shell:1,"first arg" arg2}+` +
|
||||
`+${split_shell:-1,"first arg" arg2}+` +
|
||||
`+${split_shell:count,"first arg" arg2}+` +
|
||||
`+${split_shell:random,"first arg" arg2}+` |
|
||||
`+first arg+` +
|
||||
`+arg2+` +
|
||||
`+2+` +
|
||||
`+arg2+`
|
||||
>> `+${split_shell:1,"first arg" arg2}+` +
|
||||
== `+first arg+` +
|
||||
+
|
||||
>> `+${split_shell:-1,"first arg" arg2}+` +
|
||||
== `+arg2+` +
|
||||
+
|
||||
>> `+${split_shell:count,"first arg" arg2}+` +
|
||||
== `+2+` +
|
||||
+
|
||||
>> `+${split_shell:random,"first arg" arg2}+` +
|
||||
== `+arg2+`
|
||||
|
||||
| `+${re:xxx}+` | 1.1 |
|
||||
Подаци регуларног израза: +
|
||||
@@ -2608,75 +2662,91 @@ str5 = weechat.string_eval_expression("password=abc password=def", {}, {}, optio
|
||||
`+++` = последња ухваћена група, +
|
||||
`#` = индекс последње ухваћене групе _(WeeChat ≥ 1.8)_, +
|
||||
`repl_index` = индекс замене која се врши (почиње од 1) _(WeeChat ≥ 3.3)_. |
|
||||
`+${re:0}+` +
|
||||
`+${re:1}+` +
|
||||
`+${re:2}+` +
|
||||
`+${re:+}+` +
|
||||
`+${re:#}+` +
|
||||
`+${re:repl_index}+` |
|
||||
`+test1 test2+` +
|
||||
`+test1+` +
|
||||
`+test2+` +
|
||||
`+test2+` +
|
||||
`+2+` +
|
||||
`+1+`
|
||||
>> `+${re:0}+` +
|
||||
== `+test1 test2+` +
|
||||
+
|
||||
>> `+${re:1}+` +
|
||||
== `+test1+` +
|
||||
+
|
||||
>> `+${re:2}+` +
|
||||
== `+test2+` +
|
||||
+
|
||||
>> `+${re:+}+` +
|
||||
== `+test2+` +
|
||||
+
|
||||
>> `+${re:#}+` +
|
||||
== `+2+` +
|
||||
+
|
||||
>> `+${re:repl_index}+` +
|
||||
== `+1+`
|
||||
|
||||
| `+${color:име}+` | 0.4.2 |
|
||||
Кôд WeeChat боје (име боје има и необавезне атрибуте), погледајте
|
||||
функцију <<_color,color>> у вези подржаних формата. |
|
||||
`+${color:red}red text+` +
|
||||
`+${color:*214}bold orange text+` |
|
||||
`+red text+` (у црвеној) +
|
||||
`+bold orange text+` (подебљано наранџасто)
|
||||
>> `+${color:red}red text+` +
|
||||
== `+red text+` ^(1)^ +
|
||||
+
|
||||
>> `+${color:*214}bold orange text+` +
|
||||
== `+bold orange text+` ^(2)^ +
|
||||
+
|
||||
^(1)^ у црвеној +
|
||||
^(2)^ подебљано наранџасто
|
||||
|
||||
| `+${modifier:име,подаци,стринг}+` | 2.7 |
|
||||
Резултат модификатора, погледајте функцију
|
||||
<<_hook_modifier_exec,hook_modifier_exec>>. |
|
||||
`+${modifier:eval_path_home,,~}+` +
|
||||
`+${modifier:eval_path_home,directory=config,%h/weechat.conf}+` |
|
||||
`+/home/user+` +
|
||||
`+/home/user/.config/weechat/weechat.conf+`
|
||||
>> `+${modifier:eval_path_home,,~}+` +
|
||||
== `+/home/user+` +
|
||||
+
|
||||
>> `+${modifier:eval_path_home,directory=config,%h/irc.conf}+` +
|
||||
== `+/home/user/.config/weechat/irc.conf+`
|
||||
|
||||
| `+${info:име}+` +
|
||||
`+${info:име,аргументи}+` | 0.4.3 |
|
||||
Инфо из програма WeeChat или додатка, погледајте функцију
|
||||
<<_info_get,info_get>>. |
|
||||
`+${info:version}+` +
|
||||
`+${info:nick_color_name,foo}+` |
|
||||
`+1.0+` +
|
||||
`+lightblue+`
|
||||
>> `+${info:version}+` +
|
||||
== `+1.0+` +
|
||||
+
|
||||
>> `+${info:nick_color_name,foo}+` +
|
||||
== `+lightblue+`
|
||||
|
||||
| `+${base_encode:base,xxx}+` | 2.9 |
|
||||
Стринг кодиран у base 16, 32 или 64. |
|
||||
`+${base_encode:16,test string}+` +
|
||||
`+${base_encode:32,test string}+` +
|
||||
`+${base_encode:64,test string}+` |
|
||||
`+7465737420737472696E67+` +
|
||||
`+ORSXG5BAON2HE2LOM4======+` +
|
||||
`+dGVzdCBzdHJpbmc=+`
|
||||
>> `+${base_encode:16,test string}+` +
|
||||
== `+7465737420737472696E67+` +
|
||||
+
|
||||
>> `+${base_encode:32,test string}+` +
|
||||
== `+ORSXG5BAON2HE2LOM4======+` +
|
||||
+
|
||||
>> `+${base_encode:64,test string}+` +
|
||||
== `+dGVzdCBzdHJpbmc=+`
|
||||
|
||||
| `+${base_decode:base,xxx}+` | 2.9 |
|
||||
Декодиран стринг из base 16, 32 или 64. |
|
||||
`+${base_decode:16,7465737420737472696E67}+` +
|
||||
`+${base_decode:32,ORSXG5BAON2HE2LOM4======}+` +
|
||||
`+${base_decode:64,dGVzdCBzdHJpbmc=}+` |
|
||||
`+test string+` +
|
||||
`+test string+` +
|
||||
`+test string+`
|
||||
>> `+${base_decode:16,7465737420737472696E67}+` +
|
||||
== `+test string+` +
|
||||
+
|
||||
>> `+${base_decode:32,ORSXG5BAON2HE2LOM4======}+` +
|
||||
== `+test string+` +
|
||||
+
|
||||
>> `+${base_decode:64,dGVzdCBzdHJpbmc=}+` +
|
||||
== `+test string+`
|
||||
|
||||
| `+${date}+` +
|
||||
`+${date:xxx}+` | 1.3 |
|
||||
Текући датум/време, у прилагођеном формату (погледајте `man strftime`),
|
||||
подразумевани формат је `%F %T`. |
|
||||
`+${date}+` +
|
||||
`+${date:%H:%M:%S}+` |
|
||||
`+2015-06-30 19:02:45+` +
|
||||
`+19:02:45+`
|
||||
>> `+${date}+` +
|
||||
== `+2015-06-30 19:02:45+` +
|
||||
+
|
||||
>> `+${date:%H:%M:%S}+` +
|
||||
== `+19:02:45+`
|
||||
|
||||
| `+${env:ИМЕ}+` | 1.2 |
|
||||
Име променљиве окружења `ИМЕ`. |
|
||||
`+${env:HOME}+` |
|
||||
`+/home/user+`
|
||||
>> `+${env:HOME}+` +
|
||||
== `+/home/user+`
|
||||
|
||||
| `+${if:condition}+` +
|
||||
`+${if:condition?true}+`
|
||||
@@ -2684,8 +2754,8 @@ str5 = weechat.string_eval_expression("password=abc password=def", {}, {}, optio
|
||||
Тернарни оператор са условом, вредност када је услов истинит (није обавезна) и
|
||||
друга вредност када је услов неистинит (није обавезна). Ако се вредности не
|
||||
задају, враћа се „1” или „0”, у зависности од резултата услова. |
|
||||
`+${if:${info:term_width}>80?big:small}+` |
|
||||
`+big+`
|
||||
>> `+${if:${info:term_width}>80?big:small}+` +
|
||||
== `+big+`
|
||||
|
||||
| `+${calc:xxx}+` | 2.7 |
|
||||
Резултат израза, у коме су подржане заграде и следећи
|
||||
@@ -2697,65 +2767,75 @@ str5 = weechat.string_eval_expression("password=abc password=def", {}, {}, optio
|
||||
`+//+`: резултат дељења без разломљеног дела +
|
||||
`+%+`: остатак при дељењу +
|
||||
`+**+`: степен. |
|
||||
`+${calc:5+2*3}+` +
|
||||
`+${calc:(5+2)*3}+` +
|
||||
`+${calc:10/4}+` +
|
||||
`+${calc:10//4}+` +
|
||||
`+${calc:9.2%3}+` +
|
||||
`+${calc:2**16}+` |
|
||||
`+11+` +
|
||||
`+21+` +
|
||||
`+2.5+` +
|
||||
`+2+` +
|
||||
`+0.2+` +
|
||||
`+65536+`
|
||||
>> `+${calc:5+2*3}+` +
|
||||
== `+11+` +
|
||||
+
|
||||
>> `+${calc:(5+2)*3}+` +
|
||||
== `+21+` +
|
||||
+
|
||||
>> `+${calc:10/4}+` +
|
||||
== `+2.5+` +
|
||||
+
|
||||
>> `+${calc:10//4}+` +
|
||||
== `+2+` +
|
||||
+
|
||||
>> `+${calc:9.2%3}+` +
|
||||
== `+0.2+` +
|
||||
+
|
||||
>> `+${calc:2**16}+` +
|
||||
== `+65536+`
|
||||
|
||||
| `+${random:min,max}+` | 3.3 |
|
||||
Случајни цео број из опсега `min` до `max` (укључујући и њих). |
|
||||
`+${random:0,10}+` |
|
||||
`+3+`
|
||||
>> `+${random:0,10}+` +
|
||||
== `+3+`
|
||||
|
||||
| `+${translate:xxx}+` | 3.2 |
|
||||
Преведени стринг (зависи од језика који програм WeeChat користи за приказ порука). |
|
||||
`+${translate:Plugin}+` |
|
||||
`+Extension+` (пример из француског)
|
||||
>> `+${translate:Plugin}+` +
|
||||
== `+Extension+` ^(1)^ +
|
||||
+
|
||||
^(1)^ пример из француског
|
||||
|
||||
| `+${define:name,value}+` | 3.4 |
|
||||
Дефинисање променљиве `име` постављене на `вредност`, која онда може да се користи у истом
|
||||
израчунатом изразу са `+${име}+`. |
|
||||
`+${define:len,${calc:5+3}}${len}x${len}+` |
|
||||
`+8x8+`
|
||||
>> `+${define:len,${calc:5+3}}${len}x${len}+` +
|
||||
== `+8x8+`
|
||||
|
||||
| `+${sec.data.име}+` | |
|
||||
Вредност обезбеђених података `име`. |
|
||||
`+${sec.data.libera_pass}+` |
|
||||
`+my_password+`
|
||||
>> `+${sec.data.libera_pass}+` +
|
||||
== `+my_password+`
|
||||
|
||||
| `+${фајл.одељак.опција}+` | |
|
||||
Вредност опције. |
|
||||
`+${weechat.look.buffer_time_format}+` |
|
||||
`+%H:%M:%S+`
|
||||
>> `+${weechat.look.buffer_time_format}+` +
|
||||
== `+%H:%M:%S+`
|
||||
|
||||
| `+${име}+` | |
|
||||
Вредност локалне променљиве `име` у баферу. |
|
||||
`+${nick}+` |
|
||||
`+FlashCode+`
|
||||
>> `+${nick}+` +
|
||||
== `+FlashCode+`
|
||||
|
||||
| `+${pointer}+` | |
|
||||
Променљива `pointer` из хеш табеле _pointers_. |
|
||||
`+${buffer}+` |
|
||||
`+0x1234abcd+`
|
||||
>> `+${buffer}+` +
|
||||
== `+0x1234abcd+`
|
||||
|
||||
| `+${hdata.пром1.пром2...}+` +
|
||||
`+${hdata[листа].пром1.пром2...}+` | |
|
||||
Hdata вредност (показивачи `window` и `buffer` се подразумевано постављају на текући
|
||||
прозор/бафер), `листа` може бити име листе (пример: „gui_buffers”), показивач
|
||||
(пример: „0x1234abcd”) или име показивача (пример: „my_pointer”). |
|
||||
`+${buffer[gui_buffers].full_name}+` +
|
||||
`+${buffer[my_buffer_pointer].full_name}+` +
|
||||
`+${window.buffer.number}+` |
|
||||
`+core.weechat+` +
|
||||
`+1+`
|
||||
>> `+${buffer[gui_buffers].full_name}+` +
|
||||
== `+core.weechat+` +
|
||||
+
|
||||
>> `+${buffer[my_buffer_pointer].full_name}+` +
|
||||
== `+core.weechat+` +
|
||||
+
|
||||
>> `+${window.buffer.number}+` +
|
||||
== `+1+`
|
||||
|===
|
||||
|
||||
==== string_dyn_alloc
|
||||
|
||||
Reference in New Issue
Block a user