dejagnu
[Top][All Lists]
Advanced

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

Re: PATCH: simplifying regular expressions


From: Jacob Bachmeyer
Subject: Re: PATCH: simplifying regular expressions
Date: Sun, 09 Dec 2018 18:58:28 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.22) Gecko/20090807 MultiZilla/1.8.3.4e SeaMonkey/1.1.17 Mnenhy/0.7.6.0

Ben Elliston 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.

Any objections if I go through and clean up a bunch of these?

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.


-- Jacob




reply via email to

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