tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

TRE regex

Back in 2009, Matthias-Christian Ott ported Ville Laurikari's regex
library, apparently with the intention of replacing the one in base,
originally from Henry Spencer.

What happened?  Other than the announcement, I find no discussion about
it.  I see it's in pkgsrc, all well and good, but why was  the project
was undertaken and the work not brought into base?  

In case you are feeling complacent about NetBSD's regex, the awk
documentation relies on it, and falls short.  Awk claims to implement
regex per egrep(1) -- providing no further description -- but that's
just docurot: 

	$ echo aaa | egrep 'a{3}' | wc -l
	$ echo aaa | awk '/a{3}/' | wc -l

As far as I know, we have 3 regex definitions in base: GNU grep, NetBSD
sed (with regex(3), defined by re_format(7)), and NetBSD awk.  It would
be an improvement IMO to use one implementation for all utilities in
base, to make them internally consistent and dependable (and
reproducible), even at the expense of compatibilitly with GNU's


Home | Main Index | Thread Index | Old Index