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 1mvPT4-0000G4-Lb for pgsql-general@arkaria.postgresql.org; Thu, 09 Dec 2021 19:52:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mvPT2-0007aZ-NX for pgsql-general@arkaria.postgresql.org; Thu, 09 Dec 2021 19:52:36 +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 1mvPT2-0007aQ-D9 for pgsql-general@lists.postgresql.org; Thu, 09 Dec 2021 19:52:36 +0000 Received: from mail.hjp.at ([212.17.106.138] helo=rorschach.hjp.at) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mvPSy-0003NR-8r for pgsql-general@lists.postgresql.org; Thu, 09 Dec 2021 19:52:36 +0000 Received: by rorschach.hjp.at (Postfix, from userid 1000) id 137925E34; Thu, 9 Dec 2021 20:52:30 +0100 (CET) Date: Thu, 9 Dec 2021 20:52:30 +0100 From: "Peter J. Holzer" To: pgsql-general@lists.postgresql.org Subject: Re: Detecting repeated phrase in a string Message-ID: <20211209195230.c4k2khw5znijnvrl@hjp.at> Mail-Followup-To: pgsql-general@lists.postgresql.org References: <20211209133510.lkn6vjh5eqpi5csg@hjp.at> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="oqvnd2cwj2egvewi" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --oqvnd2cwj2egvewi Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2021-12-09 16:11:31 +0100, Andreas Joseph Krogh wrote: > For repeated words (including unicode-chars) you can do: > =A0 > (\b\p{L}+\b)(?:\s+\1)+ > =A0 > I'm not quite sure how to translate this to PG, but in JAVA it works. See https://www.postgresql.org/docs/11/functions-matching.html#POSIX-CONSTR= AINT-ESCAPES-TABLE hp --=20 _ | Peter J. Holzer | Story must make more sense than reality. |_|_) | | | | | hjp@hjp.at | -- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" --oqvnd2cwj2egvewi Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEETtJbRjyPwVTYGJ5k8g5IURL+KF0FAmGyXnkACgkQ8g5IURL+ KF0tew/8DDR7Nv+bi29vo9tAzBCGG7v2YI+FlfqdebVJJ81xzWdQrDMXesF8iY0J 2+xUmI8d6hK8/cH9iAL81jbtakcQh1MqQ98lfFv5TLhke8Tc47GjgUTfEkyM66cj M/OdsFs4oBlhJ3H3w2lZNFVIHAqWPMXHimQkAfxrAT2RVUapaCA0wSHwCVPiqaBL 1nhCVhWrP84pffVl0Xejsvv9IamYL9u4bDlt7EdrZMflDWOafOGzRPrF781cGqfX v6UGVq/5pPlM8JB0Esevfa32AY9Kt7iLvKtJdQ6XzJbJFrh9rfXJ+a5bdW58kgQt A6mtEDgdZHi2vM5GooIDiPUEGdh3qEmO6RVIiNL3gt3TC2tCPmHgyA9wkvTWwQkz vn6vj08a72yBBl4+pwy8gyFPqCFC1h2lrg7dVki2/KA77efQdOL1VS9vO31TYTgD k3wqr0E0BmaaFZ2xhu17RT3SQ4Qerg9Bvp3UxUc1Jdg5KVVLD/JndhzWtoGS1xS0 dwGcWE/JxgGUWjeZpLf7NzfHdRrHr1SOytzpnf9tQgL+Dcwlz48/kJWCAnmzQvDv wG8OpcVmzFyR9m+jPWxDm4v97Vx/UHE6qP6Ayep/rbLBg2gXO8WmPBTPMhpGyR+u 49tiKGdquIerAnOyYpxePrRSfhzMVMgKZ024GXznx9RYtq4s/ws= =zYgQ -----END PGP SIGNATURE----- --oqvnd2cwj2egvewi--