Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qAhZU-0008OU-TB for pgsql-general@arkaria.postgresql.org; Sun, 18 Jun 2023 01:51:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qAhYU-0001qm-Gr for pgsql-general@arkaria.postgresql.org; Sun, 18 Jun 2023 01:50:14 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qAhYU-0001n9-6Z for pgsql-general@lists.postgresql.org; Sun, 18 Jun 2023 01:50:14 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qAhYR-0039Qd-Av for pgsql-general@lists.postgresql.org; Sun, 18 Jun 2023 01:50:13 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 35I1o8Wt2659556; Sat, 17 Jun 2023 21:50:09 -0400 From: Tom Lane To: "=?ISO-8859-1?B?V2VuIFlp?=" <896634148@qq.com> cc: "=?ISO-8859-1?B?cGdzcWwtZ2VuZXJhbA==?=" Subject: Re: Is there a way make the lex program match multiple line? In-reply-to: References: Comments: In-reply-to "=?ISO-8859-1?B?V2VuIFlp?=" <896634148@qq.com> message dated "Sun, 18 Jun 2023 09:17:53 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2659554.1687053008.1@sss.pgh.pa.us> Date: Sat, 17 Jun 2023 21:50:08 -0400 Message-ID: <2659555.1687053008@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "=?ISO-8859-1?B?V2VuIFlp?=" <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