Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] [gdb/testsuite] Fix gdb.tui/resize-3.exp on ppc64-linux
Date: Sat, 18 Oct 2025 11:11:52 +0200	[thread overview]
Message-ID: <ddb366a5-7e7d-42bd-b9fe-b442e4c0bc48@suse.de> (raw)
In-Reply-To: <d51080eb-544b-4841-8609-14ee97c0d616@suse.de>

On 10/18/25 10:21 AM, Tom de Vries wrote:
> On 10/17/25 4:14 PM, Tom Tromey wrote:
>> Tom> -    "$hex\\s+<foo"
>> Tom> +    [string cat $hex {\s+} "<" ([string_to_regexp .])? "foo"]
>>
>> Personally I find this a lot less readable than just writing out the
>> regular expression.
> 
> How about:
> ...
> set re_dot [string_to_regexp "."]
> set re [string cat $hex {\s+} "<" "($re_dot)?" "foo"]
> ...
> 
> Or:
> ...
> set re [string cat $hex {\s+} "<" {(\.)?} "foo"]
> ...
> 
Forgot to mention, a while back I proposed an extension to 
stringlist_to_regexp where using -re as an escape means don't use 
string_to_regexp because this part is already a regexp.

Using that method, we'd get:
...
set re \
     [stringlist_to_regexp \
         -re $hex -re {\s+} "<" -re "(" "." -re ")?" "foo"]
...

Thanks,
- Tom

  reply	other threads:[~2025-10-18  9:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-17 13:39 Tom de Vries
2025-10-17 14:14 ` Tom Tromey
2025-10-18  8:21   ` Tom de Vries
2025-10-18  9:11     ` Tom de Vries [this message]
2025-10-18 17:19     ` Tom Tromey
2025-10-20 10:08       ` Tom de Vries

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ddb366a5-7e7d-42bd-b9fe-b442e4c0bc48@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox