diff --git a/lib/search/normal.c b/lib/search/normal.c
index 4287e21..49e4567 100644
a
|
b
|
mc_search__cond_struct_new_init_normal (const char *charset, mc_search_t * lc_mc |
94 | 94 | if (lc_mc_search->whole_words) |
95 | 95 | { |
96 | 96 | /* NOTE: \b as word boundary doesn't allow search |
97 | | * whole words with non-ASCII symbols */ |
98 | | g_string_prepend (tmp, "(^|[^\\p{L}\\p{N}_])("); |
99 | | g_string_append (tmp, ")([^\\p{L}\\p{N}_]|$)"); |
| 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}_])"); |
100 | 101 | } |
101 | 102 | |
102 | 103 | mc_search_cond->str = tmp; |
diff --git a/lib/search/regex.c b/lib/search/regex.c
index 1711af4..ba8b4df 100644
a
|
b
|
mc_search__run_regex (mc_search_t * lc_mc_search, const void *user_data, |
906 | 906 | { |
907 | 907 | case COND__FOUND_OK: |
908 | 908 | #ifdef SEARCH_TYPE_GLIB |
909 | | if (lc_mc_search->whole_words) |
910 | | g_match_info_fetch_pos (lc_mc_search->regex_match_info, 2, &start_pos, &end_pos); |
911 | | else |
912 | | g_match_info_fetch_pos (lc_mc_search->regex_match_info, 0, &start_pos, &end_pos); |
| 909 | g_match_info_fetch_pos (lc_mc_search->regex_match_info, 0, &start_pos, &end_pos); |
913 | 910 | #else /* SEARCH_TYPE_GLIB */ |
914 | | if (lc_mc_search->whole_words) |
915 | | { |
916 | | start_pos = lc_mc_search->iovector[4]; |
917 | | end_pos = lc_mc_search->iovector[5]; |
918 | | } |
919 | | else |
920 | | { |
921 | | start_pos = lc_mc_search->iovector[0]; |
922 | | end_pos = lc_mc_search->iovector[1]; |
923 | | } |
| 911 | start_pos = lc_mc_search->iovector[0]; |
| 912 | end_pos = lc_mc_search->iovector[1]; |
924 | 913 | #endif /* SEARCH_TYPE_GLIB */ |
925 | 914 | if (found_len != NULL) |
926 | 915 | *found_len = end_pos - start_pos; |