regex.7x (2141B)
- .\" This file is part of Cross Unix Documentation
- .\" Copyright © 2019 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
- .\" SPDX-License-Identifier: CC-BY-4.0
- .Dd 2025-04-24
- .Dt REGEX 7x
- .Os
- .Sh PROLOG
- This manual page is part of
- .Lk https://hacktivis.me/git/cross-unix-documentation "Cross-Unix Documentation"
- which is an attempt to provide documentation of similarities and (noteworthy) differencies between Unix-like systems.
- To be used as an addition to the POSIX standard.
- .Sh NAME
- .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
- \exHH \ex{HHHH}
- .It
- \e+ and \e? treated as repetitions in BRE
- .It
- \e| as alternation in BRE
- .It
- 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
- .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
- .El
- .Sh SEE ALSO
- .Lk "Austin Group Bug 1919: Add \eA and \ez to regular expressions" https://www.austingroupbugs.net/view.php?id=1919
- .Sh SOURCE
- .Sh AUTHORS
- .An Haelwenn (lanodan) Monnier Aq Mt contact+c-u-d@hacktivis.me