Re: Is there a way make the lex program match multiple line?

From: Wen Yi <896634148(at)qq(dot)com>
To: Tom&nbsp;Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Is there a way make the lex program match multiple line?
Date: 2023-06-18 02:53:39
Message-ID: tencent_D2F4990B589DF8AA97A93B645C5CA39BA406@qq.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I rewrite, and I think the [']([^']|\n)['] should be [']([^']|\n)+[']
Thanks very much!

Yours,
Wen Yi.

&nbsp;

------------------&nbsp;Original&nbsp;------------------
From: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us&gt;;
Date:&nbsp;Sun, Jun 18, 2023 09:50 AM
To:&nbsp;"Wen Yi"<896634148(at)qq(dot)com&gt;;
Cc:&nbsp;"pgsql-general"<pgsql-general(at)lists(dot)postgresql(dot)org&gt;;
Subject:&nbsp;Re: Is there a way make the lex program match multiple line?

"=?ISO-8859-1?B?V2VuIFlp?=" <896634148(at)qq(dot)com&gt; writes:
&gt; Can someone give me some advice to make the ['].+['] match multiple string?

You should check the flex manual, but it's likely that "." doesn't
match newline.&nbsp; Another problem with this pattern is that "."
*does* match "'", so it's ambiguous what will happen with quotes.
You probably need something closer to [']([^']|\n)[']

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message James Cloos 2023-06-18 06:06:19 deb’s pg_upgradecluster(1) vs streaming replication
Previous Message Tom Lane 2023-06-18 01:50:08 Re: Is there a way make the lex program match multiple line?