logo

cross-unix-documentation

documentation of similarities and (noteworthy) differencies between Unix systems git clone https://anongit.hacktivis.me/git/cross-unix-documentation.git/

regex.7x (2141B)


  1. .\" This file is part of Cross Unix Documentation
  2. .\" Copyright © 2019 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
  3. .\" SPDX-License-Identifier: CC-BY-4.0
  4. .Dd 2025-04-24
  5. .Dt REGEX 7x
  6. .Os
  7. .Sh PROLOG
  8. This manual page is part of
  9. .Lk https://hacktivis.me/git/cross-unix-documentation "Cross-Unix Documentation"
  10. which is an attempt to provide documentation of similarities and (noteworthy) differencies between Unix-like systems.
  11. To be used as an addition to the POSIX standard.
  12. .Sh NAME
  13. .Nm regex
  14. .Nd Extensions to POSIX regular expressions
  15. .Sh DESCRIPTION
  16. .Bl -tag -width [[:>:]]
  17. .It Cm [[:<:]]
  18. Anchors to beginning of a word
  19. (4.4BSD, NetBSD, OpenBSD, FreeBSD)
  20. .It Cm [[:>:]]
  21. Anchors to end of a word
  22. (4.4BSD, NetBSD, OpenBSD, FreeBSD)
  23. .It Cm \e<
  24. Anchors to beginning of a word
  25. (NetBSD, OpenBSD, FreeBSD, GNU, musl)
  26. .It Cm \e>
  27. Anchors to end of a word
  28. (NetBSD, OpenBSD, FreeBSD, GNU, musl)
  29. .It Cm \eb
  30. Matches word boundary
  31. (GNU, musl)
  32. .It Cm \eB
  33. Matches word non-boundary characters
  34. (GNU, musl)
  35. .It Cm \ew
  36. Matches word characters
  37. (GNU)
  38. .It Cm \eW
  39. Matches non-word characters
  40. (GNU)
  41. .It Cm \e`
  42. matches the beginning of the whole input
  43. (GNU)
  44. .It Cm \e'
  45. matches the beginning of the whole input
  46. (GNU)
  47. .El
  48. .Sh ADDITIONAL NOTES
  49. .Ss musl
  50. Derived from laurikari's tre library.
  51. .Bl -bullet -compact
  52. .It
  53. "[a-z--@] is accepted as [a-z]|[--@]"
  54. .It
  55. \exHH \ex{HHHH}
  56. .It
  57. \e+ and \e? treated as repetitions in BRE
  58. .It
  59. \e| as alternation in BRE
  60. .It
  61. Accept unknown escape char as literal
  62. .It
  63. "empty branch is unspecified (), (|a), (a|) here they are not rejected but match on empty string"
  64. .El
  65. .Ss GNU
  66. .Lk https://www.gnu.org/software/findutils/manual/html_node/find_html/posix_002dextended-regular-expression-syntax.html
  67. .\" Somehow glibc doesn't documents it's extensions, would otherwise be in https://sourceware.org/glibc/manual/latest/html_node/Regular-Expressions.html
  68. .Bl -bullet -compact
  69. .It
  70. \e+ and \e? treated as repetitions
  71. .El
  72. .Sh SEE ALSO
  73. .Lk "Austin Group Bug 1919: Add \eA and \ez to regular expressions" https://www.austingroupbugs.net/view.php?id=1919
  74. .Sh SOURCE
  75. .Sh AUTHORS
  76. .An Haelwenn (lanodan) Monnier Aq Mt contact+c-u-d@hacktivis.me