diff -NaurpBb mc-4.7.0-pre1-orig/debian/rules mc-4.7.0-pre1/debian/rules
--- mc-4.7.0-pre1-orig/debian/rules	2009-12-23 18:50:33.000000000 +0300
+++ mc-4.7.0-pre1/debian/rules	2009-12-23 18:50:44.083907635 +0300
@@ -5,7 +5,7 @@ include /usr/share/cdbs/1/class/autotool
 include /usr/share/cdbs/1/rules/patchsys-quilt.mk
 
 DEB_DH_STRIP_ARGS := --dbg-package=mc-dbg
-DEB_CONFIGURE_EXTRA_FLAGS := --with-glib2 --without-ext2undel --enable-charset --without-samba --with-screen=slang
+DEB_CONFIGURE_EXTRA_FLAGS := --with-glib2 --without-ext2undel --enable-charset --with-samba --with-screen=slang --with-search-engine=pcre
 AWK := awk
 #improve build time on i386 and amd64 multi CPU.
 DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
diff -NaurpBb mc-4.7.0-pre1-orig/src/main.c mc-4.7.0-pre1/src/main.c
--- mc-4.7.0-pre1-orig/src/main.c	2009-07-31 20:36:25.000000000 +0400
+++ mc-4.7.0-pre1/src/main.c	2009-12-23 18:50:44.083907635 +0300
@@ -239,10 +239,10 @@ int confirm_view_dir = 0;
 /* This flag indicates if the pull down menus by default drop down */
 int drop_menus = 0;
 
-/* if skip_check_codeset = 1 do not show warning about
- * system and display codeset is different
- */
-int skip_check_codeset = 0;
+/* if auto_fix_codeset = 0 show warning about system and display codeset is different
+   if auto_fix_codeset = 1 don't show warning, don't fix it automatically
+   if auto_fix_codeset = 2 don't show warning, fix it automatically */
+int auto_fix_codeset = 0;
 
 /* The dialog handle for the main program */
 Dlg_head *midnight_dlg = NULL;
@@ -1462,11 +1462,13 @@ static void check_codeset()
     const char *_source_codepage = NULL;
     const char *_display_codepage = NULL;
     int profile_changed = 0;
+    int dont_ask_again = 0;
+    int st = 0;
 
 #define CONFY 16
 #define CONFX 54
 
-    if ( !skip_check_codeset ) {
+    if ( auto_fix_codeset != 1 ) {
 
         QuickWidget ecs_widgets [] = {
         { quick_button, 4, 6, 13, CONFY, N_("&Skip"),
@@ -1474,7 +1476,7 @@ static void check_codeset()
         { quick_button, 1, 11, 13, CONFY, N_("&Fix it"),
           0, B_ENTER, 0, 0, NULL , NULL, NULL},
         { quick_checkbox, 1, 13, 11, CONFY, N_("don't ask again"),
-          11, 0, &skip_check_codeset, NULL, NULL , NULL, NULL},
+          11, 0, &dont_ask_again, NULL, NULL , NULL, NULL},
         { quick_label, 2, 30, 3, CONFY, N_("Chosen display charset (Settings->Display bits)\n"
                                            "or source codeset (in mcedit ctrl-t) \n"
                                            "does not match one set via locale. \n"
@@ -1498,7 +1500,17 @@ static void check_codeset()
 
         if ( (strcmp (_system_codepage, _display_codepage)) ||
              (strcmp (_system_codepage, _source_codepage)) ) {
-            if (quick_dialog (&ecs) == B_ENTER){
+            if (!auto_fix_codeset)
+            {
+                st = quick_dialog (&ecs);
+                if (dont_ask_again)
+                {
+                    auto_fix_codeset = st == B_ENTER ? 2 : 1;
+                    mc_config_set_int(mc_main_config, "Midnight-Commander", "auto_fix_codeset", auto_fix_codeset);
+                    profile_changed = 1;
+                }
+            }
+            if (auto_fix_codeset == 2 || st == B_ENTER) {
                 display_codepage = get_codepage_index (_system_codepage);
                 cp_display = get_codepage_id (display_codepage);
                 if ( !strcmp (cp_display, _system_codepage)) {
@@ -1510,11 +1522,6 @@ static void check_codeset()
                     cp_source = cp_display;
                     profile_changed = 1;
                 }
-            } else {
-                if ( skip_check_codeset ) {
-                    mc_config_set_int(mc_main_config, "Midnight-Commander", "skip_check_codeset", 1);
-                    profile_changed = 1;
-                }
             }
         }
         if ( profile_changed )
diff -NaurpBb mc-4.7.0-pre1-orig/src/main.h mc-4.7.0-pre1/src/main.h
--- mc-4.7.0-pre1-orig/src/main.h	2009-07-31 20:36:25.000000000 +0400
+++ mc-4.7.0-pre1/src/main.h	2009-12-23 18:50:44.083907635 +0300
@@ -79,7 +79,7 @@ extern int midnight_shutdown;
 extern char cmd_buf [512];
 extern const char *shell;
 extern int auto_fill_mkdir_name;
-extern int skip_check_codeset;
+extern int auto_fix_codeset;
 /* Ugly hack in order to distinguish between left and right panel in menubar */
 extern int is_right;		/* If the selected menu was the right */
 #define MENU_PANEL (is_right ? right_panel : left_panel)
diff -NaurpBb mc-4.7.0-pre1-orig/src/search/regex.c mc-4.7.0-pre1/src/search/regex.c
--- mc-4.7.0-pre1-orig/src/search/regex.c	2009-07-31 20:36:26.000000000 +0400
+++ mc-4.7.0-pre1/src/search/regex.c	2009-12-23 18:50:44.083907635 +0300
@@ -63,7 +63,7 @@ mc_search__regex_str_append_if_special (
     const char *special_chars[] = {
         "\\s", "\\S",
         "\\d", "\\D",
-        "\\B", "\\B",
+        "\\b", "\\B",
         "\\w", "\\W",
         "\\t", "\\n",
         "\\r", "\\f",
@@ -348,7 +348,7 @@ static int
 mc_search_regex__process_replace_str (const GString * replace_str, const gsize current_pos,
                                       gsize * skip_len, replace_transform_type_t * replace_flags)
 {
-    int ret = -1;
+    int ret = -1; /* nothing special */
     char *tmp_str;
     const char *curr_str = &(replace_str->str[current_pos]);
 
@@ -360,7 +360,7 @@ mc_search_regex__process_replace_str (co
     if (*curr_str == '$' && *(curr_str + 1) == '{' && (*(curr_str + 2) & (char) 0xf0) == 0x30) {
         if (strutils_is_char_escaped (replace_str->str, curr_str)) {
             *skip_len = 1;
-            return -1;
+            return -1; /* nothing special */
         }
 
         for (*skip_len = 0;
@@ -368,33 +368,88 @@ mc_search_regex__process_replace_str (co
              && (*(curr_str + 2 + *skip_len) & (char) 0xf0) == 0x30; (*skip_len)++);
 
         if (*(curr_str + 2 + *skip_len) != '}')
-            return -1;
+            return -1; /* nothing special */
 
         tmp_str = g_strndup (curr_str + 2, *skip_len);
         if (tmp_str == NULL)
-            return -1;
+            return -1; /* nothing special */
 
         ret = atoi (tmp_str);
         g_free (tmp_str);
 
         *skip_len += 3;         /* ${} */
-        return ret;
+        return ret; /* capture buffer index >= 0 */
     }
 
     if (*curr_str == '\\') {
+        char next_char;
         if (strutils_is_char_escaped (replace_str->str, curr_str)) {
             *skip_len = 1;
-            return -1;
+            return -1; /* nothing special */
         }
 
-        if ((*(curr_str + 1) & (char) 0xf0) == 0x30) {
-            ret = *(curr_str + 1) - '0';
+        next_char = *(curr_str + 1);
+        if ((next_char & (char) 0xf0) == 0x30) {
+            ret = next_char - '0'; /* capture buffer index >= 0 */
             *skip_len = 2;      /* \\ and one digit */
             return ret;
         }
-        ret = -2;
+
+        if (next_char == '{')
+        {
+            for (*skip_len = 2; /* \{ */
+                 current_pos + *skip_len < replace_str->len
+                 && (*(curr_str + *skip_len)) != '}'; (*skip_len)++);
+            if (current_pos + *skip_len < replace_str->len)
+                (*skip_len)++;
+            return -3; /* escape sequence */
+        }
+
+        if (next_char == 'x')
+        {
+            *skip_len = 2; /* \x */
+            next_char = *(curr_str + 2);
+            if (next_char == '{')
+            {
+                for (*skip_len = 3; /* \x{ */
+                     current_pos + *skip_len < replace_str->len
+                     && (*(curr_str + *skip_len)) != '}'; (*skip_len)++);
+                if (current_pos + *skip_len < replace_str->len)
+                    (*skip_len)++;
+                return -3; /* escape sequence */
+            }
+            else if ((next_char < '0' || next_char > '9') &&
+                (next_char < 'a' || next_char > 'f') &&
+                (next_char < 'A' || next_char > 'F'))
+            {
+                *skip_len = 2; /* \x without number behind */
+                return -1; /* nothing special */
+            }
+            else
+            {
+                next_char = *(curr_str + 3);
+                if ((next_char < '0' || next_char > '9') &&
+                    (next_char < 'a' || next_char > 'f') &&
+                    (next_char < 'A' || next_char > 'F'))
+                    *skip_len = 3; /* \xH */
+                else
+                    *skip_len = 4; /* \xHH */
+                return -3; /* escape sequence */
+            }
+        }
+
+        if (next_char == 'n' || next_char == 't' ||
+            next_char == 'v' || next_char == 'b' ||
+            next_char == 'r' || next_char == 'f' ||
+            next_char == 'a')
+        {
+            *skip_len = 2;
+            return -3; /* escape sequence */
+        }
+
+        ret = -2; /* replace flag */
         *skip_len += 2;
-        switch (*(curr_str + 1)) {
+        switch (next_char) {
         case 'U':
             *replace_flags |= REPLACE_T_UPP_TRANSFORM;
             *replace_flags &= ~REPLACE_T_LOW_TRANSFORM;
@@ -413,7 +468,7 @@ mc_search_regex__process_replace_str (co
             *replace_flags = REPLACE_T_NO_TRANSFORM;
             break;
         default:
-            ret = -1;
+            ret = -1; /* nothing special */
             break;
         }
     }
@@ -469,13 +524,66 @@ mc_search_regex__process_append_str (GSt
 
 }
 
+static void
+mc_search_regex__process_escape_sequence (GString * dest_str, const char *from, gsize len,
+                                          replace_transform_type_t * replace_flags)
+{
+    gsize i = 0;
+    char c = 0;
+    if (len == (gsize) -1)
+        len = strlen (from);
+    if (len <= 0)
+        return;
+    if (from[i] == '{')
+        i++;
+    if (i >= len)
+        return;
+    if (from[i] == 'x')
+    {
+        i++;
+        if (i < len && from[i] == '{')
+            i++;
+        for (; i < len; i++)
+        {
+            if (from[i] >= '0' && from[i] <= '9')
+                c = c*16 + from[i] - '0';
+            else if (from[i] >= 'a' && from[i] <= 'f')
+                c = c*16 + 10 + from[i] - 'a';
+            else if (from[i] >= 'A' && from[i] <= 'F')
+                c = c*16 + 10 + from[i] - 'A';
+            else
+                break;
+        }
+    }
+    else if (from[i] >= '0' && from[i] <= '9')
+        for (; i < len && from[i] >= '0' && from[i] <= '7'; i++)
+            c = c*8 + from[i] - '0';
+    else
+    {
+        switch (from[i])
+        {
+            case 'n': c = '\n'; break;
+            case 't': c = '\t'; break;
+            case 'v': c = '\v'; break;
+            case 'b': c = '\b'; break;
+            case 'r': c = '\r'; break;
+            case 'f': c = '\f'; break;
+            case 'a': c = '\a'; break;
+            default:
+                mc_search_regex__process_append_str(dest_str, from, len, replace_flags);
+                return;
+        }
+    }
+    g_string_append_len (dest_str, &c, 1);
+}
+
 /*** public functions ****************************************************************************/
 
 void
 mc_search__cond_struct_new_init_regex (const char *charset, mc_search_t * mc_search,
                                        mc_search_cond_t * mc_search_cond)
 {
-    GString *tmp = NULL;
+    int utf8 = 0;
 #ifdef SEARCH_TYPE_GLIB
     GError *error = NULL;
 #else /* SEARCH_TYPE_GLIB */
@@ -483,13 +591,13 @@ mc_search__cond_struct_new_init_regex (c
     int erroffset;
 #endif /* SEARCH_TYPE_GLIB */
 
+#ifdef SEARCH_TYPE_GLIB
     if (!mc_search->is_case_sentitive) {
-        tmp = g_string_new_len (mc_search_cond->str->str, mc_search_cond->str->len);
+        GString *tmp = g_string_new_len (mc_search_cond->str->str, mc_search_cond->str->len);
         g_string_free (mc_search_cond->str, TRUE);
         mc_search_cond->str = mc_search__cond_struct_new_regex_ci_str (charset, tmp->str, tmp->len);
         g_string_free (tmp, TRUE);
     }
-#ifdef SEARCH_TYPE_GLIB
     mc_search_cond->regex_handle =
         g_regex_new (mc_search_cond->str->str, G_REGEX_OPTIMIZE | G_REGEX_RAW | G_REGEX_DOTALL, 0,
                      &error);
@@ -501,8 +609,10 @@ mc_search__cond_struct_new_init_regex (c
         return;
     }
 #else /* SEARCH_TYPE_GLIB */
+    if (charset && !strncasecmp(charset, "utf-8", 6))
+        utf8 = 1;
     mc_search_cond->regex_handle =
-        pcre_compile (mc_search_cond->str->str, PCRE_EXTRA, &error, &erroffset, NULL);
+        pcre_compile (mc_search_cond->str->str, (!mc_search->is_case_sentitive ? PCRE_CASELESS : 0) | PCRE_MULTILINE | (utf8 ? PCRE_UTF8 : 0) | PCRE_EXTRA, &error, &erroffset, NULL);
     if (mc_search_cond->regex_handle == NULL) {
         mc_search->error = MC_SEARCH_E_REGEX_COMPILE;
         mc_search->error_str = g_strdup (error);
@@ -635,6 +745,7 @@ mc_search_regex_prepare_replace_str (mc_
     for (loop = 0; loop < replace_str->len - 1; loop++) {
         index = mc_search_regex__process_replace_str (replace_str, loop, &len, &replace_flags);
 
+        /* nothing special */
         if (index == -1) {
             if (len != 0) {
                 mc_search_regex__process_append_str (ret, prev_str,
@@ -648,6 +759,7 @@ mc_search_regex_prepare_replace_str (mc_
             continue;
         }
 
+        /* replace flag (transform) */
         if (index == -2) {
             if (loop)
                 mc_search_regex__process_append_str (ret, prev_str,
@@ -658,6 +770,18 @@ mc_search_regex_prepare_replace_str (mc_
             continue;
         }
 
+        /* escape sequence */
+        if (index == -3) {
+            mc_search_regex__process_append_str (ret, prev_str,
+                                                 replace_str->str - prev_str + loop,
+                                                 &replace_flags);
+            mc_search_regex__process_escape_sequence (ret, replace_str->str + loop + 1, len - 1,
+                                                      &replace_flags);
+            prev_str = replace_str->str + loop + len;
+            loop += len - 1;
+            continue;
+        }
+
         if (index > mc_search->num_rezults) {
             g_string_free (ret, TRUE);
             mc_search->error = MC_SEARCH_E_REGEX_REPLACE;
diff -NaurpBb mc-4.7.0-pre1-orig/src/setup.c mc-4.7.0-pre1/src/setup.c
--- mc-4.7.0-pre1-orig/src/setup.c	2009-07-31 20:36:26.000000000 +0400
+++ mc-4.7.0-pre1/src/setup.c	2009-12-23 18:50:44.083907635 +0300
@@ -194,7 +194,7 @@ static const struct {
     { "xtree_mode", &xtree_mode },
     { "num_history_items_recorded", &num_history_items_recorded },
     { "file_op_compute_totals", &file_op_compute_totals },
-    { "skip_check_codeset", &skip_check_codeset },
+    { "auto_fix_codeset", &auto_fix_codeset },
 #ifdef USE_VFS
     { "vfs_timeout", &vfs_timeout },
 #ifdef USE_NETCODE
