[PATCH v2 0/2] MR10294: Fix start word position \\<
findstr.exe accepts both ^ and \\\\\< as start-of-line designations, although the latter wasn't implemented. -- v2: findstr.exe: only partially implementing start word position findstr.exe: fix start word position \\< https://gitlab.winehq.org/wine/wine/-/merge_requests/10294
From: Trent Waddington <trent.waddington@tensorworks.com.au> --- programs/findstr/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/programs/findstr/main.c b/programs/findstr/main.c index 7e8a3299e89..2bb1e4b1939 100644 --- a/programs/findstr/main.c +++ b/programs/findstr/main.c @@ -172,7 +172,9 @@ static BOOL match_star(char c, const char *str, const char *regexp, UINT pos, BO static BOOL match_regexp(const char *str, const char *regexp, BOOL case_sensitive) { if (strstr(regexp, "[")) FIXME("character ranges (i.e. [abc], [^a-z]) are not supported\n"); - if (strstr(regexp, "\\<") || strstr(regexp, "\\>")) FIXME("word position (i.e. \\< and \\>) not supported\n"); + if (strstr(regexp, "\\>")) FIXME("end of word position (i.e. \\>) not supported\n"); + + if (regexp[0] == '\\' && regexp[1] == '<') return match_here(str, regexp, 2, case_sensitive); if (regexp[0] == '^') return match_here(str, regexp, 1, case_sensitive); do { if (match_here(str, regexp, 0, case_sensitive)) return TRUE; } while (*str++); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10294
From: Trent Waddington <trent.waddington@tensorworks.com.au> --- programs/findstr/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/findstr/main.c b/programs/findstr/main.c index 2bb1e4b1939..891ee165fb3 100644 --- a/programs/findstr/main.c +++ b/programs/findstr/main.c @@ -172,7 +172,7 @@ static BOOL match_star(char c, const char *str, const char *regexp, UINT pos, BO static BOOL match_regexp(const char *str, const char *regexp, BOOL case_sensitive) { if (strstr(regexp, "[")) FIXME("character ranges (i.e. [abc], [^a-z]) are not supported\n"); - if (strstr(regexp, "\\>")) FIXME("end of word position (i.e. \\>) not supported\n"); + if (strstr(regexp, "\\<") != regexp || strstr(regexp, "\\>")) FIXME("word position (i.e. \\< and \\>) not supported\n"); if (regexp[0] == '\\' && regexp[1] == '<') return match_here(str, regexp, 2, case_sensitive); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10294
On Thu Mar 12 06:45:04 2026 +0000, Hans Leidekker wrote:
This only implements \\< at the beginning of the regular expression and only if the string to match starts with a word. We should at least keep the FIXME. Agreed. Restored the FIXME for start word when it's not at the beginning of the regexp.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/10294#note_131929
On Thu Mar 12 08:00:41 2026 +0000, Trent Waddington wrote:
Agreed. Restored the FIXME for start word when it's not at the beginning of the regexp. Please squash the commits.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/10294#note_131947
participants (3)
-
Hans Leidekker (@hans) -
Trent Waddington -
Trent Waddington (@trent.waddington)