summaryrefslogtreecommitdiff
path: root/doc/en
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2010-11-25 21:28:14 +0100
committerSebastien Helleu <flashcode@flashtux.org>2010-11-25 21:28:14 +0100
commite92079cfe9c2ad89cf4c9f7d2ce146f4393cb9f4 (patch)
tree09343bd04a8c939351237d3babdcf0b05f0a0eb4 /doc/en
parent8b9abab711ccdccceafcbea351b8bef0d23b8ecd (diff)
downloadweechat-e92079cfe9c2ad89cf4c9f7d2ce146f4393cb9f4.zip
Add new option weechat.look.highlight_regex and function string_has_highlight_regex in plugin API (task #10321)
Diffstat (limited to 'doc/en')
-rw-r--r--doc/en/autogen/user/weechat_options.txt5
-rw-r--r--doc/en/weechat_plugin_api.en.txt43
2 files changed, 48 insertions, 0 deletions
diff --git a/doc/en/autogen/user/weechat_options.txt b/doc/en/autogen/user/weechat_options.txt
index 0586b4e9c..8779f96da 100644
--- a/doc/en/autogen/user/weechat_options.txt
+++ b/doc/en/autogen/user/weechat_options.txt
@@ -388,6 +388,11 @@
** type: string
** values: any string (default value: `""`)
+* *weechat.look.highlight_regex*
+** description: `regular expression used to check if a message has highlight or not, at least one match in string must be surrounded by word chars (alphanumeric, "-", "_" or "|"), regular expression is case sensitive, example: "FlashCode|flashy"`
+** type: string
+** values: any string (default value: `""`)
+
* *weechat.look.hline_char*
** description: `char used to draw horizontal lines, note that empty value will draw a real line with ncurses, but may cause bugs with URL selection under some terminals`
** type: string
diff --git a/doc/en/weechat_plugin_api.en.txt b/doc/en/weechat_plugin_api.en.txt
index e1ccfb010..ce6ac9cdc 100644
--- a/doc/en/weechat_plugin_api.en.txt
+++ b/doc/en/weechat_plugin_api.en.txt
@@ -933,6 +933,49 @@ highlight = weechat.string_has_highlight(string, highlight_words)
highlight = weechat.string_has_highlight("my test string", "test,word2") # 1
----------------------------------------
+weechat_string_has_highlight_regex
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+_New in version 0.3.4._
+
+Check if a string has one or more highlights, using a regular expression.
+For at least one match of regular expression on string, it must be surrounded
+by word chars (alphanumeric character, "-", "_" or "|").
+
+Prototype:
+
+[source,C]
+----------------------------------------
+int weechat_string_has_highlight_regex (const char *string, const char *regex);
+----------------------------------------
+
+Arguments:
+
+* 'string': string
+* 'regex': regular expression
+
+Return value:
+
+* 1 if string has one or more highlights, otherwise 0
+
+C example:
+
+[source,C]
+----------------------------------------
+int hl = weechat_string_has_highlight_regex ("my test string", "test|word2"); /* == 1 */
+----------------------------------------
+
+Script (Python):
+
+[source,python]
+----------------------------------------
+# prototype
+highlight = weechat.string_has_highlight_regex(string, regex)
+
+# example
+highlight = weechat.string_has_highlight_regex("my test string", "test|word2") # 1
+----------------------------------------
+
weechat_string_mask_to_regex
^^^^^^^^^^^^^^^^^^^^^^^^^^^^