summaryrefslogtreecommitdiff
path: root/doc/it/weechat_plugin_api.it.txt
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/it/weechat_plugin_api.it.txt
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/it/weechat_plugin_api.it.txt')
-rw-r--r--doc/it/weechat_plugin_api.it.txt44
1 files changed, 44 insertions, 0 deletions
diff --git a/doc/it/weechat_plugin_api.it.txt b/doc/it/weechat_plugin_api.it.txt
index fdee54429..ef00a156f 100644
--- a/doc/it/weechat_plugin_api.it.txt
+++ b/doc/it/weechat_plugin_api.it.txt
@@ -954,6 +954,50 @@ highlight = weechat.string_has_highlight(string, highlight_words)
highlight = weechat.string_has_highlight("my test string", "test,word2") # 1
----------------------------------------
+// TRANSLATION MISSING
+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
^^^^^^^^^^^^^^^^^^^^^^^^^^^^