[Bug 287396] grep(1): BSD grep \w matches differently from GNU grep

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 08 Aug 2025 16:45:54 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=287396

Kyle Evans <kevans@freebsd.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kevans@freebsd.org
           Assignee|bugs@FreeBSD.org            |kevans@freebsd.org

--- Comment #2 from Kyle Evans <kevans@freebsd.org> ---
(In reply to OHARA Shigeki from comment #0)

We map \w to [[:alnum:]], and in the POSIX locale _ doesn't fit the bill
(neither a `digit` nor a `alpha`).  I'm looking at the documentation[0] again,
and I see now that it is explicitly alnum + _.  I will fix this.

[0]
https://www.gnu.org/software/grep/manual/html_node/The-Backslash-Character-and-Special-Expressions.html

-- 
You are receiving this mail because:
You are the assignee for the bug.