summaryrefslogtreecommitdiff
path: root/doc/en
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2020-05-05 20:43:45 +0200
committerSébastien Helleu <flashcode@flashtux.org>2020-05-05 20:43:45 +0200
commitb1c3a29ac759a15cb2ade7e96d7f1b4d1ce28935 (patch)
treeffae98f0157ffa2031c4591877950454009d194c /doc/en
parent8df8d20f81dc64bb286f5d1a1d629d050949893d (diff)
downloadweechat-b1c3a29ac759a15cb2ade7e96d7f1b4d1ce28935.zip
core: add include comparison operators in evaluation of expressions
New comparison operators: - "==*": is matching mask, case sensitive (wildcard "*" is allowed) - "!!*": is NOT matching mask, case sensitive (wildcard "*" is allowed) - "==-": is included, case sensitive - "!!-": is NOT included, case sensitive - "=-": is included, case insensitive - "!-": is NOT included, case insensitive
Diffstat (limited to 'doc/en')
-rw-r--r--doc/en/includes/autogen_user_commands.en.adoc31
-rw-r--r--doc/en/weechat_plugin_api.en.adoc67
2 files changed, 77 insertions, 21 deletions
diff --git a/doc/en/includes/autogen_user_commands.en.adoc b/doc/en/includes/autogen_user_commands.en.adoc
index f9f7f59eb..427b99d4d 100644
--- a/doc/en/includes/autogen_user_commands.en.adoc
+++ b/doc/en/includes/autogen_user_commands.en.adoc
@@ -1289,19 +1289,25 @@ infolists: display infos about infolists
expression: expression to evaluate, variables with format ${variable} are replaced (see below); many commands can be separated by semicolons
operator: a logical or comparison operator:
- logical operators:
- && boolean "and"
- || boolean "or"
+ && boolean "and"
+ || boolean "or"
- comparison operators:
- == equal
- != not equal
- <= less or equal
- < less
- >= greater or equal
- > greater
- =~ is matching POSIX extended regex
- !~ is NOT matching POSIX extended regex
- =* is matching mask (wildcard "*" is allowed)
- !* is NOT matching mask (wildcard "*" is allowed)
+ == equal
+ != not equal
+ <= less or equal
+ < less
+ >= greater or equal
+ > greater
+ =~ is matching POSIX extended regex
+ !~ is NOT matching POSIX extended regex
+ ==* is matching mask, case sensitive (wildcard "*" is allowed)
+ !!* is NOT matching mask, case sensitive (wildcard "*" is allowed)
+ =* is matching mask, case insensitive (wildcard "*" is allowed)
+ !* is NOT matching mask, case insensitive (wildcard "*" is allowed)
+ ==- is included, case sensitive
+ !!- is NOT included, case sensitive
+ =- is included, case insensitive
+ !- is NOT included, case insensitive
An expression is considered as "true" if it is not NULL, not empty, and different from "0".
The comparison is made using floating point numbers if the two expressions are valid numbers, with one of the following formats:
@@ -1370,6 +1376,7 @@ Examples (conditions):
/eval -n -c abcd =~ (?-i)^abc ==> 1
/eval -n -c abcd !~ abc ==> 0
/eval -n -c abcd =* a*d ==> 1
+ /eval -n -c abcd =- bc ==> 1
----
[[command_weechat_filter]]
diff --git a/doc/en/weechat_plugin_api.en.adoc b/doc/en/weechat_plugin_api.en.adoc
index d0fe0192f..692ff6e70 100644
--- a/doc/en/weechat_plugin_api.en.adoc
+++ b/doc/en/weechat_plugin_api.en.adoc
@@ -2148,7 +2148,8 @@ str3 = weechat.string_input_for_buffer("//test") # "/test"
==== string_eval_expression
-_WeeChat ≥ 0.4.0, updated in 0.4.2, 0.4.3, 1.0, 1.1, 1.2, 1.3, 1.6, 1.8, 2.0, 2.2, 2.3 and 2.7._
+_WeeChat ≥ 0.4.0, updated in 0.4.2, 0.4.3, 1.0, 1.1, 1.2, 1.3, 1.6, 1.8, 2.0,
+2.2, 2.3, 2.7 and 2.9._
Evaluate an expression and return result as a string.
Special variables with format `+${variable}+` are expanded (see table below).
@@ -2313,19 +2314,67 @@ from first used to last):
`+0+` +
`+1+`
-| `+=*+` +
+| `+==*+` |
+ Is matching mask where "*" is allowed, case sensitive (see function <<_string_match,string_match>>) +
+ _(WeeChat ≥ 2.9)_ |
+ `+abc def ==* a*f+` +
+ `+abc def ==* y*z+` |
+ `+1+` +
+ `+0+`
+
+| `+!!*+` |
+ Is NOT wildcard mask where "*" is allowed, case sensitive (see function <<_string_match,string_match>>) +
+ _(WeeChat ≥ 2.9)_ |
+ `+abc def !!* a*f+` +
+ `+abc def !!* y*z+` |
+ `+0+` +
+ `+1+`
+
+| `+=*+` |
+ Is matching mask where "*" is allowed, case insensitive (see function <<_string_match,string_match>>) +
_(WeeChat ≥ 1.8)_ |
- Is matching mask where "*" is allowed (see function <<_string_match,string_match>>) |
- `+abc def =* a*f+` +
- `+abc def =* y*z+` |
+ `+abc def =* A*F+` +
+ `+abc def =* Y*Z+` |
`+1+` +
`+0+`
-| `+!*+` +
+| `+!*+` |
+ Is NOT wildcard mask where "*" is allowed, case insensitive (see function <<_string_match,string_match>>) +
_(WeeChat ≥ 1.8)_ |
- Is NOT wildcard mask where "*" is allowed (see function <<_string_match,string_match>>) |
- `+abc def !* a*f+` +
- `+abc def !* y*z+` |
+ `+abc def !* A*F+` +
+ `+abc def !* Y*Z+` |
+ `+0+` +
+ `+1+`
+
+| `+==-+` |
+ Is included, case sensitive +
+ _(WeeChat ≥ 2.9)_ |
+ `+abc def ==- bc+` +
+ `+abc def ==- xyz+` |
+ `+1+` +
+ `+0+`
+
+| `+!!-+` |
+ Is NOT included, case sensitive +
+ _(WeeChat ≥ 2.9)_ |
+ `+abc def !!- bc+` +
+ `+abc def !!- xyz+` |
+ `+0+` +
+ `+1+`
+
+| `+=-+` |
+ Is included, case insensitive +
+ _(WeeChat ≥ 2.9)_ |
+ `+abc def =- BC+` +
+ `+abc def =- XYZ+` |
+ `+1+` +
+ `+0+`
+
+| `+!-+` |
+ Is NOT included, case insensitive +
+ _(WeeChat ≥ 2.9)_ |
+ `+abc def !- BC+` +
+ `+abc def !- XYZ+` |
`+0+` +
`+1+`