Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Sun, 19 Apr 2020 21:26:35 -0400
From: Rich Felker <>
To: "liheng (P)" <>
Cc: Szabolcs Nagy <>,
	"" <>,
	Florian Weimer <>,
	"Xiangrui (Euler)" <>,
	Lizefan <>
Subject: Re: regex Back reference matching result not same as glibc
 and tre.

On Sun, Apr 19, 2020 at 12:26:58PM +0000, liheng (P) wrote:
> Ok, you are right, I retest to match "aba" by pat[] =
> "\\(.\\?\\).\\?\\1" success without tags (basic regular expression
> mode I think). regcomp1(&rbuf, pat, 0);
> But my point is that why pat[] = "(.?).?\\1" to match "aba" in
> extended regular expression mode that success in glibc and failed in
> musl? Are musl-regex and glibc-regex different?

Having backreferences in regular expressions is inherently a bug,
because it makes them non-regular and unsafe for use where the
expression is user input and finishing in finite time is a
requirement. They're supported in BRE because it's a historical
requirement impossed by the standard, but a major *feature* of ERE is
actually being regular and not having backreferences.


Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.