[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lmi] First experience with std::regex from gcc 11 and CTRE in test_
From: |
Vadim Zeitlin |
Subject: |
Re: [lmi] First experience with std::regex from gcc 11 and CTRE in test_coding_rules |
Date: |
Thu, 3 Jun 2021 12:47:48 +0200 |
On Thu, 3 Jun 2021 10:41:11 +0000 Greg Chicares <gchicares@sbcglobal.net> wrote:
GC> On 6/3/21 12:55 AM, Vadim Zeitlin wrote:
GC> [...]
GC> > Sorry, I forgot to mention that there is another rather annoying problem
GC> > with it that I discovered today: it doesn't seem to properly support
GC> > backtracking, i.e. "a.*b" is never going to find anything because ".*"
GC> > will consume "b". This could be a blessing in disguise because we'd need
to
GC> > rewrite all inefficient regexes that rely on it to avoid backtracking
GC>
GC> IOW, we should replace 'a.*b' with 'a[^b]*b'?
Yes, this is what I did so far. I.e. instead of "^config(_.*)?\.hpp$" I
use "^config(_[^.]*)?\.hpp$" etc.
BTW, some regexes using ".*" seem not optimal, e.g. we're searching for
"Copyright \(C\).*2021" in check_copyright(), which seems rather over
broad. But I don't concern myself with such details for now...
VZ
pgpIR5rPKpmZT.pgp
Description: PGP signature