From 611b45c379af5d690b3a01d1847950411ebce2bd Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Tue, 3 Jan 2023 13:15:22 +0100 Subject: Minor improvement to word boundaries \b \B. --- src/cregex.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cregex.c b/src/cregex.c index dcfefe24..658d7929 100644 --- a/src/cregex.c +++ b/src/cregex.c @@ -1060,8 +1060,8 @@ _regexec1(const _Reprog *progp, /* program to run */ case TOK_NWBOUND: ok = true; case TOK_WBOUND: /* fallthrough */ - if (ok ^ (s == bol || s == j->eol || ((utf8_isalnum(utf8_peek_off(s, -1)) || s[-1] == '_') - ^ (utf8_isalnum(utf8_peek(s)) || s[0] == '_')))) + if (ok ^ (s == bol || s == j->eol || (utf8_isword(utf8_peek_off(s, -1)) + ^ utf8_isword(utf8_peek(s))))) continue; break; case TOK_NCCLASS: -- cgit v1.2.3