diff --git a/lib/search/normal.c b/lib/search/normal.c
index 49e4567..2ebe463 100644
a
|
b
|
mc_search__cond_struct_new_init_normal (const char *charset, mc_search_t * lc_mc |
91 | 91 | tmp = mc_search__normal_translate_to_regex (mc_search_cond->str); |
92 | 92 | g_string_free (mc_search_cond->str, TRUE); |
93 | 93 | |
94 | | if (lc_mc_search->whole_words) |
95 | | { |
96 | | /* NOTE: \b as word boundary doesn't allow search |
97 | | * whole words with non-ASCII symbols. |
98 | | * Update: Is it still true nowadays? Probably not. #2396, #3524 */ |
99 | | g_string_prepend (tmp, "(?<![\\p{L}\\p{N}_])"); |
100 | | g_string_append (tmp, "(?![\\p{L}\\p{N}_])"); |
101 | | } |
102 | | |
103 | 94 | mc_search_cond->str = tmp; |
104 | 95 | mc_search__cond_struct_new_init_regex (charset, lc_mc_search, mc_search_cond); |
105 | 96 | } |
diff --git a/lib/search/regex.c b/lib/search/regex.c
index ba8b4df..da41df5 100644
a
|
b
|
void |
740 | 740 | mc_search__cond_struct_new_init_regex (const char *charset, mc_search_t * lc_mc_search, |
741 | 741 | mc_search_cond_t * mc_search_cond) |
742 | 742 | { |
| 743 | if (lc_mc_search->whole_words && !lc_mc_search->is_entire_line) |
| 744 | { |
| 745 | /* NOTE: \b as word boundary doesn't allow search |
| 746 | * whole words with non-ASCII symbols. |
| 747 | * Update: Is it still true nowadays? Probably not. #2396, #3524 */ |
| 748 | g_string_prepend (mc_search_cond->str, "(?<![\\p{L}\\p{N}_])"); |
| 749 | g_string_append (mc_search_cond->str, "(?![\\p{L}\\p{N}_])"); |
| 750 | } |
| 751 | |
| 752 | { |
743 | 753 | #ifdef SEARCH_TYPE_GLIB |
744 | 754 | GError *mcerror = NULL; |
745 | 755 | |
… |
… |
mc_search__cond_struct_new_init_regex (const char *charset, mc_search_t * lc_mc_ |
799 | 809 | } |
800 | 810 | } |
801 | 811 | #endif /* SEARCH_TYPE_GLIB */ |
| 812 | } |
802 | 813 | lc_mc_search->is_utf8 = str_isutf8 (charset); |
803 | 814 | } |
804 | 815 | |