commit: b1864e5b6113c1d9d8d6b53e912431ec22bac54c
parent 6ff080a8149cde09dedafa30d2d2967108a7cb00
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Fri, 6 Jun 2025 08:04:56 +0200
man7x/regex.7x: Detail expressions meanings, add BSDs
Diffstat:
1 file changed, 35 insertions(+), 4 deletions(-)
diff --git a/man7x/regex.7x b/man7x/regex.7x
@@ -13,13 +13,46 @@ To be used as an addition to the POSIX standard.
.Nm regex
.Nd Extensions to POSIX regular expressions
.Sh DESCRIPTION
+.Bl -tag -width [[:>:]]
+.It Cm [[:<:]]
+Anchors to beginning of a word
+(4.4BSD, NetBSD, OpenBSD, FreeBSD)
+.It Cm [[:>:]]
+Anchors to end of a word
+(4.4BSD, NetBSD, OpenBSD, FreeBSD)
+.It Cm \e<
+Anchors to beginning of a word
+(NetBSD, OpenBSD, FreeBSD, GNU, musl)
+.It Cm \e>
+Anchors to end of a word
+(NetBSD, OpenBSD, FreeBSD, GNU, musl)
+.It Cm \eb
+Matches word boundary
+(GNU, musl)
+.It Cm \eB
+Matches word non-boundary characters
+(GNU, musl)
+.It Cm \ew
+Matches word characters
+(GNU)
+.It Cm \eW
+Matches non-word characters
+(GNU)
+.It Cm \e`
+matches the beginning of the whole input
+(GNU)
+.It Cm \e'
+matches the beginning of the whole input
+(GNU)
+.El
+.Sh ADDITIONAL NOTES
.Ss musl
Derived from laurikari's tre library.
.Bl -bullet -compact
.It
"[a-z--@] is accepted as [a-z]|[--@]"
.It
-\eb \eB \e< \e> \exHH \ex{HHHH}
+\exHH \ex{HHHH}
.It
\e+ and \e? treated as repetitions in BRE
.It
@@ -29,14 +62,12 @@ Accept unknown escape char as literal
.It
"empty branch is unspecified (), (|a), (a|) here they are not rejected but match on empty string"
.El
-.Ss GNU glibc
+.Ss GNU
.Lk https://www.gnu.org/software/findutils/manual/html_node/find_html/posix_002dextended-regular-expression-syntax.html
.\" Somehow glibc doesn't documents it's extensions, would otherwise be in https://sourceware.org/glibc/manual/latest/html_node/Regular-Expressions.html
.Bl -bullet -compact
.It
\e+ and \e? treated as repetitions
-.It
-\e< \e> \eb \eB \e` \e'
.El
.Sh SEE ALSO
.Lk "Austin Group Bug 1919: Add \eA and \ez to regular expressions" https://www.austingroupbugs.net/view.php?id=1919