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

Поиск
Список
Период
Сортировка
От Wen Yi
Тема Re: Is there a way make the lex program match multiple line?
Дата
Msg-id tencent_D2F4990B589DF8AA97A93B645C5CA39BA406@qq.com
обсуждение исходный текст
Ответ на Re: Is there a way make the lex program match multiple line?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
I rewrite, and I think the [']([^']|\n)['] should be [']([^']|\n)+[']
Thanks very much!

Yours,
Wen Yi.



 


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

"Wen Yi" <896634148@qq.com> writes:
> 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.  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

В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Is there a way make the lex program match multiple line?
Следующее
От: James Cloos
Дата:
Сообщение: deb’s pg_upgradecluster(1) vs streaming replication