From 878b8cfa29fd1347e86814d3d09b1f188d5483a5 Mon Sep 17 00:00:00 2001 From: schwarze Date: Sat, 6 Aug 2022 19:04:49 +0000 Subject: [PATCH] Improve HISTORY and add AUTHORS. In particular, mention the 4.0BSD and v8/Tahoe APIs that were supported until OpenBSD 5.4 and that matter for the evolution of RE functions in the BSD libc. Joint work with and OK jsg@. Regarding authorship of the v8 functions, Russ Cox writes near the end of https://swtch.com/~rsc/regexp/regexp1.html : "While writing the text editor sam in the early 1980s, Rob Pike wrote a new regular expression implementation, which Dave Presotto extracted into a library that appeared in the Eighth Edition. Pike's implementation incorporated submatch tracking into an efficient NFA simulation but, like the rest of the Eighth Edition source, was not widely distributed. Pike himself did not realize that his technique was anything new. Henry Spencer reimplemented the Eighth Edition library interface from scratch, but using backtracking, and released his implementation into the public domain. It became very widely used, eventually serving as the basis for the slow regular expression implementations mentioned earlier: Perl, PCRE, Python, and so on. (In his defense, Spencer knew the routines could be slow, and he didn't know that a more efficient algorithm existed. He even warned in the documentation, "Many users have found the speed perfectly adequate, although replacing the insides of egrep with this code would be a mistake.") Pike's regular expression implementation, extended to support Unicode, was made freely available with sam in late 1992, but the particularly efficient regular expression search algorithm went unnoticed." [...] --- lib/libc/regex/regex.3 | 66 +++++++++++++++++++++++++++++++++++------- 1 file changed, 56 insertions(+), 10 deletions(-) diff --git a/lib/libc/regex/regex.3 b/lib/libc/regex/regex.3 index f2cc3c8abc9..60ca7c3ebb6 100644 --- a/lib/libc/regex/regex.3 +++ b/lib/libc/regex/regex.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: regex.3,v 1.28 2022/08/06 11:05:23 schwarze Exp $ +.\" $OpenBSD: regex.3,v 1.29 2022/08/06 19:04:49 schwarze Exp $ .\" .\" Copyright (c) 1997, Phillip F Knaack. All rights reserved. .\" @@ -626,19 +626,65 @@ sections 2.8 (Regular Expression Notation) and B.5 (C Binding for Regular Expression Matching). .Sh HISTORY -Predecessors to -.Fn regcomp -and -.Fn regexec , +Predecessors called .Fn regcmp and -.Fn regex , -first appeared in the Programmer's Workbench (PWB/UNIX). +.Fn regex +first appeared in PWB/UNIX 1.0. .Pp -The present functions were originally written by Henry Spencer -and altered for inclusion in the +Predecessors +.Fn re_comp +and +.Fn re_exec +first appeared in +.Bx 4.0 , +became part of +.In unistd.h +in +.Bx 4.4 , +and were deleted after +.Ox 5.4 . +.Pp +Functions called +.Fn regcomp , +.Fn regexec , +.Fn regerror , +and +.Fn regsub +first appeared in Version\~8 +.At , +were reimplemented and declared in +.In regexp.h +for +.Bx 4.3 Tahoe , +and were also deleted after +.Ox 5.4 . +.Pp +Taking different arguments, the POSIX +.In regex.h +functions +.Fn regcomp , +.Fn regexec , +.Fn regerror , +and +.Fn regfree +appeared in +.Bx 4.4 . +.Sh AUTHORS +.An -nosplit +The +Version\~8 +.At +code was implemented by +.An Rob Pike +and extracted into a library by +.An Dave Presotto . +The +.Bx 4.3 Tahoe +and .Bx 4.4 -distribution. +versions were both written by +.An Henry Spencer . .Sh BUGS The implementation of internationalization is incomplete: the locale is always assumed to be the default one of -- 2.20.1