[Top][All Lists]

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

Re: PATCH: simplifying regular expressions

From: Ben Elliston
Subject: Re: PATCH: simplifying regular expressions
Date: Mon, 10 Dec 2018 12:03:43 +1100
User-agent: Mutt/1.9.4 (2018-02-28)

On Sun, Dec 09, 2018 at 06:58:28PM -0600, Jacob Bachmeyer wrote:

> > A lot of regular expressions in DejaGnu are complex for no good
> > reason. This is because the regexps are placed inside quotes ("..")
> > wich are processed before being passed to the relevant function (be it
> > 'expect', 'regexp', 'regsub', etc). As long as the string is a
> > constant, it is possible to put the regexp in braces and eliminate one
> > additional level of backslash quoting.  Here are a few examples from
> > lib/telnet.exp. As you can see, the regexps become quite a bit
> > clearer, even for these fairly simple cases.

> That is good for lib/telnet.exp, but some files, like
> lib/dejagnu.exp and testsuite/runtests.all/libs.exp substitute
> variables into the regexps.

This is why I said "as long as the string is constant". ;-)

For strings containing varaible substitutions, I don't think there is
much we can do.


Attachment: signature.asc
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]