diff --git a/src/gui/gui-buffer.c b/src/gui/gui-buffer.c
index bb62d3d..65403dd 100644
--- a/src/gui/gui-buffer.c
+++ b/src/gui/gui-buffer.c
@@ -1803,17 +1803,29 @@ gui_buffer_search_main ()
 
 /*
  * Searches for a buffer by plugin and name.
+ * case insensitive search enabled with "(?i)"
  */
 
 struct t_gui_buffer *
 gui_buffer_search_by_name (const char *plugin, const char *name)
 {
     struct t_gui_buffer *ptr_buffer;
-    int plugin_match;
+    int plugin_match, length, case_insensitive_flag;
+    char *name2;
 
     if (!name || !name[0])
         return gui_current_window->buffer;
 
+    case_insensitive_flag = 0;
+
+    if (strncmp(name, "(?i)", 4) == 0)
+    {
+        case_insensitive_flag = 1;
+        length = strlen (name);
+        name2 = malloc (length);
+        strcpy (name2,name + 4);
+    }
+
     for (ptr_buffer = gui_buffers; ptr_buffer;
          ptr_buffer = ptr_buffer->next_buffer)
     {
@@ -1825,7 +1837,12 @@ gui_buffer_search_by_name (const char *plugin, const char *name)
                 if (strcmp (plugin, gui_buffer_get_plugin_name (ptr_buffer)) != 0)
                     plugin_match = 0;
             }
-            if (plugin_match && (strcmp (ptr_buffer->name, name) == 0))
+            if (case_insensitive_flag && plugin_match && (strcasecmp (ptr_buffer->name, name2) == 0))
+            {
+                free (name2);
+                return ptr_buffer;
+            }
+            if (!case_insensitive_flag && plugin_match && (strcmp (ptr_buffer->name, name) == 0))
             {
                 return ptr_buffer;
             }
@@ -1833,29 +1850,58 @@ gui_buffer_search_by_name (const char *plugin, const char *name)
     }
 
     /* buffer not found */
+    if (case_insensitive_flag)
+        free (name2);
     return NULL;
 }
 
 /*
  * Searches for a buffer by full name (example: "irc.freenode.#weechat").
+ * case insensitive search enabled with "(?i)"
  */
 
 struct t_gui_buffer *
 gui_buffer_search_by_full_name (const char *full_name)
 {
     struct t_gui_buffer *ptr_buffer;
+    int length, case_insensitive_flag;
+    char *name2;
+
+    case_insensitive_flag = 0;
+
+    if (strncmp(full_name, "(?i)", 4) == 0)
+    {
+        case_insensitive_flag = 1;
+        length = strlen (full_name);
+        name2 = malloc (length);
+        strcpy (name2,full_name + 4);
+    }
 
     for (ptr_buffer = gui_buffers; ptr_buffer;
          ptr_buffer = ptr_buffer->next_buffer)
     {
-        if (ptr_buffer->full_name
-            && (strcmp (ptr_buffer->full_name, full_name) == 0))
+        if (case_insensitive_flag)
         {
-            return ptr_buffer;
+            if (ptr_buffer->full_name
+                && (strcasecmp (ptr_buffer->full_name, name2) == 0))
+            {
+                free (name2);
+                return ptr_buffer;
+            }
+        }
+        else
+        {
+            if (ptr_buffer->full_name
+                && (strcmp (ptr_buffer->full_name, full_name) == 0))
+            {
+                return ptr_buffer;
+            }
         }
     }
 
     /* buffer not found */
+    if (case_insensitive_flag)
+        free (name2);
     return NULL;
 }
 
diff --git a/src/plugins/guile/weechat-guile-api.c b/src/plugins/guile/weechat-guile-api.c
index 92ccd56..dfa0a9c 100644
--- a/src/plugins/guile/weechat-guile-api.c
+++ b/src/plugins/guile/weechat-guile-api.c
@@ -3084,6 +3084,21 @@ weechat_guile_api_buffer_search (SCM plugin, SCM name)
 }
 
 SCM
+weechat_guile_api_buffer_search_by_full_name (SCM full_name)
+{
+    char *result;
+    SCM return_value;
+
+    API_FUNC(1, "buffer_search_by_full_name", API_RETURN_EMPTY);
+    if (!scm_is_string (full_name))
+        API_WRONG_ARGS(API_RETURN_EMPTY);
+
+    result = API_PTR2STR(weechat_buffer_search_by_full_name (API_SCM_TO_STRING(full_name)));
+
+    API_RETURN_STRING_FREE(result);
+}
+
+SCM
 weechat_guile_api_buffer_search_main ()
 {
     char *result;
@@ -4662,6 +4677,7 @@ weechat_guile_api_module_init (void *data)
     API_DEF_FUNC(unhook_all, 0);
     API_DEF_FUNC(buffer_new, 5);
     API_DEF_FUNC(buffer_search, 2);
+    API_DEF_FUNC(buffer_search_by_full_name, 1);
     API_DEF_FUNC(buffer_search_main, 0);
     API_DEF_FUNC(current_buffer, 0);
     API_DEF_FUNC(buffer_clear, 1);
diff --git a/src/plugins/lua/weechat-lua-api.c b/src/plugins/lua/weechat-lua-api.c
index e7554ab..66cd058 100644
--- a/src/plugins/lua/weechat-lua-api.c
+++ b/src/plugins/lua/weechat-lua-api.c
@@ -3328,6 +3328,23 @@ weechat_lua_api_buffer_search (lua_State *L)
 }
 
 static int
+weechat_lua_api_buffer_search_by_full_name (lua_State *L)
+{
+    const char *full_name;
+    char *result;
+
+    API_FUNC(1, "buffer_search_by_full_name", API_RETURN_EMPTY);
+    if (lua_gettop (lua_current_interpreter) < 1)
+        API_WRONG_ARGS(API_RETURN_EMPTY);
+
+    full_name = lua_tostring (lua_current_interpreter, -1);
+
+    result = API_PTR2STR(weechat_buffer_search_by_full_name (full_name));
+
+    API_RETURN_STRING_FREE(result);
+}
+
+static int
 weechat_lua_api_buffer_search_main (lua_State *L)
 {
     char *result;
@@ -5138,6 +5155,7 @@ const struct luaL_Reg weechat_lua_api_funcs[] = {
     API_DEF_FUNC(unhook_all),
     API_DEF_FUNC(buffer_new),
     API_DEF_FUNC(buffer_search),
+    API_DEF_FUNC(buffer_search_by_full_name),
     API_DEF_FUNC(buffer_search_main),
     API_DEF_FUNC(current_buffer),
     API_DEF_FUNC(buffer_clear),
diff --git a/src/plugins/perl/weechat-perl-api.c b/src/plugins/perl/weechat-perl-api.c
index 3578e9f..9a05ee3 100644
--- a/src/plugins/perl/weechat-perl-api.c
+++ b/src/plugins/perl/weechat-perl-api.c
@@ -3146,6 +3146,22 @@ XS (XS_weechat_api_buffer_search)
     API_RETURN_STRING_FREE(result);
 }
 
+XS (XS_weechat_api_buffer_search_by_full_name)
+{
+    char *result, *full_name;
+    dXSARGS;
+
+    API_FUNC(1, "buffer_search_by_full_name", API_RETURN_EMPTY);
+    if (items < 1)
+        API_WRONG_ARGS(API_RETURN_EMPTY);
+
+    full_name = SvPV_nolen (ST (0));
+
+    result = API_PTR2STR(weechat_buffer_search_by_full_name (full_name));
+
+    API_RETURN_STRING_FREE(result);
+}
+
 XS (XS_weechat_api_buffer_search_main)
 {
     char *result;
@@ -4895,6 +4911,7 @@ weechat_perl_api_init (pTHX)
     API_DEF_FUNC(unhook_all);
     API_DEF_FUNC(buffer_new);
     API_DEF_FUNC(buffer_search);
+    API_DEF_FUNC(buffer_search_by_full_name);
     API_DEF_FUNC(buffer_search_main);
     API_DEF_FUNC(current_buffer);
     API_DEF_FUNC(buffer_clear);
diff --git a/src/plugins/plugin.c b/src/plugins/plugin.c
index 207b891..6afcefd 100644
--- a/src/plugins/plugin.c
+++ b/src/plugins/plugin.c
@@ -672,6 +672,7 @@ plugin_load (const char *filename, int argc, char **argv)
 
         new_plugin->buffer_new = &gui_buffer_new;
         new_plugin->buffer_search = &gui_buffer_search_by_name;
+        new_plugin->buffer_search_by_full_name = &gui_buffer_search_by_full_name;
         new_plugin->buffer_search_main = &gui_buffer_search_main;
         new_plugin->buffer_clear = &gui_buffer_clear;
         new_plugin->buffer_close = &gui_buffer_close;
diff --git a/src/plugins/python/weechat-python-api.c b/src/plugins/python/weechat-python-api.c
index 6eef2ac..6c8e44e 100644
--- a/src/plugins/python/weechat-python-api.c
+++ b/src/plugins/python/weechat-python-api.c
@@ -3285,6 +3285,23 @@ weechat_python_api_buffer_search (PyObject *self, PyObject *args)
 }
 
 static PyObject *
+weechat_python_api_buffer_search_by_full_name (PyObject *self, PyObject *args)
+{
+    char *full_name;
+    char *result;
+    PyObject *return_value;
+
+    API_FUNC(1, "buffer_search_by_full_name", API_RETURN_EMPTY);
+    full_name = NULL;
+    if (!PyArg_ParseTuple (args, "s", &full_name))
+        API_WRONG_ARGS(API_RETURN_EMPTY);
+
+    result = API_PTR2STR(weechat_buffer_search_by_full_name (full_name));
+
+    API_RETURN_STRING_FREE(result);
+}
+
+static PyObject *
 weechat_python_api_buffer_search_main (PyObject *self, PyObject *args)
 {
     char *result;
@@ -5047,6 +5064,7 @@ PyMethodDef weechat_python_funcs[] =
     API_DEF_FUNC(unhook_all),
     API_DEF_FUNC(buffer_new),
     API_DEF_FUNC(buffer_search),
+    API_DEF_FUNC(buffer_search_by_full_name),
     API_DEF_FUNC(buffer_search_main),
     API_DEF_FUNC(current_buffer),
     API_DEF_FUNC(buffer_clear),
diff --git a/src/plugins/ruby/weechat-ruby-api.c b/src/plugins/ruby/weechat-ruby-api.c
index a2acc67..4ac4cca 100644
--- a/src/plugins/ruby/weechat-ruby-api.c
+++ b/src/plugins/ruby/weechat-ruby-api.c
@@ -3784,6 +3784,25 @@ weechat_ruby_api_buffer_search (VALUE class, VALUE plugin, VALUE name)
 }
 
 static VALUE
+weechat_ruby_api_buffer_search_by_full_name (VALUE class, VALUE full_name)
+{
+    char *c_full_name, *result;
+    VALUE return_value;
+
+    API_FUNC(1, "buffer_search_by_full_name", API_RETURN_EMPTY);
+    if (NIL_P (full_name))
+        API_WRONG_ARGS(API_RETURN_EMPTY);
+
+    Check_Type (full_name, T_STRING);
+
+    c_full_name = StringValuePtr (full_name);
+
+    result = API_PTR2STR(weechat_buffer_search_by_full_name (c_full_name));
+
+    API_RETURN_STRING_FREE(result);
+}
+
+static VALUE
 weechat_ruby_api_buffer_search_main (VALUE class)
 {
     char *result;
@@ -5983,6 +6002,7 @@ weechat_ruby_api_init (VALUE ruby_mWeechat)
     API_DEF_FUNC(unhook_all, 0);
     API_DEF_FUNC(buffer_new, 5);
     API_DEF_FUNC(buffer_search, 2);
+    API_DEF_FUNC(buffer_search_by_full_name, 1);
     API_DEF_FUNC(buffer_search_main, 0);
     API_DEF_FUNC(current_buffer, 0);
     API_DEF_FUNC(buffer_clear, 1);
diff --git a/src/plugins/tcl/weechat-tcl-api.c b/src/plugins/tcl/weechat-tcl-api.c
index ab6613f..8a9457d 100644
--- a/src/plugins/tcl/weechat-tcl-api.c
+++ b/src/plugins/tcl/weechat-tcl-api.c
@@ -3639,6 +3639,25 @@ weechat_tcl_api_buffer_search (ClientData clientData, Tcl_Interp *interp,
 }
 
 static int
+weechat_tcl_api_buffer_search_by_full_name (ClientData clientData, Tcl_Interp *interp,
+                               int objc, Tcl_Obj *CONST objv[])
+{
+    Tcl_Obj *objp;
+    char *result, *full_name;
+    int i;
+
+    API_FUNC(1, "buffer_search_by_full_name", API_RETURN_EMPTY);
+    if (objc < 2)
+        API_WRONG_ARGS(API_RETURN_EMPTY);
+
+    full_name = Tcl_GetStringFromObj (objv[1], &i);
+
+    result = API_PTR2STR(weechat_buffer_search_by_full_name (full_name));
+
+    API_RETURN_STRING_FREE(result);
+}
+
+static int
 weechat_tcl_api_buffer_search_main (ClientData clientData, Tcl_Interp *interp,
                                     int objc, Tcl_Obj *CONST objv[])
 {
@@ -5732,6 +5751,7 @@ void weechat_tcl_api_init (Tcl_Interp *interp)
     API_DEF_FUNC(unhook_all);
     API_DEF_FUNC(buffer_new);
     API_DEF_FUNC(buffer_search);
+    API_DEF_FUNC(buffer_search_by_full_name);
     API_DEF_FUNC(buffer_search_main);
     API_DEF_FUNC(current_buffer);
     API_DEF_FUNC(buffer_clear);
diff --git a/src/plugins/weechat-plugin.h b/src/plugins/weechat-plugin.h
index 429eeec..f5bde0c 100644
--- a/src/plugins/weechat-plugin.h
+++ b/src/plugins/weechat-plugin.h
@@ -675,6 +675,7 @@ struct t_weechat_plugin
                                                               struct t_gui_buffer *buffer),
                                         void *close_callback_data);
     struct t_gui_buffer *(*buffer_search) (const char *plugin, const char *name);
+    struct t_gui_buffer *(*buffer_search_by_full_name) (const char *name);
     struct t_gui_buffer *(*buffer_search_main) ();
     void (*buffer_clear) (struct t_gui_buffer *buffer);
     void (*buffer_close) (struct t_gui_buffer *buffer);
@@ -1438,6 +1439,8 @@ extern int weechat_plugin_end (struct t_weechat_plugin *plugin);
                                __close_callback, __close_callback_data)
 #define weechat_buffer_search(__plugin, __name)                         \
     weechat_plugin->buffer_search(__plugin, __name)
+#define weechat_buffer_search_by_full_name(__name)                      \
+    weechat_plugin->buffer_search_by_full_name(__name)
 #define weechat_buffer_search_main()                                    \
     weechat_plugin->buffer_search_main()
 #define weechat_current_buffer()                                        \
