Re: PATCH: simplifying regular expressions

Jacob Bachmeyer <[email protected]>
Newsgroups gmane.comp.sysutils.dejagnu.general
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.