pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter J. Holzer <hjp-pgsql@hjp.at>
To: pgsql-general@lists.postgresql.org
Subject: Re: Detecting repeated phrase in a string
Date: Thu, 9 Dec 2021 20:52:30 +0100
Message-ID: <20211209195230.c4k2khw5znijnvrl@hjp.at> (raw)
In-Reply-To: <VisenaEmail.50.2affbb94dee70e79.17d9fba1d20@tc7-visena>
References: <CA+i5Jwbe9uH5dwSvV1Ur-zf7VXMCPNsNS20+sBQx4X1Ufr_ANQ@mail.gmail.com>
	<20211209133510.lkn6vjh5eqpi5csg@hjp.at>
	<CA+i5JwaEwK=ktV-H-xS2dHgGfWL0RPRDVhcghJ5rQM45DqLY-g@mail.gmail.com>
	<VisenaEmail.50.2affbb94dee70e79.17d9fba1d20@tc7-visena>

On 2021-12-09 16:11:31 +0100, Andreas Joseph Krogh wrote:
> For repeated words (including unicode-chars) you can do:
>  
> (\b\p{L}+\b)(?:\s+\1)+
>  
> 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-CONSTRAINT-ESCAPES-TABLE

        hp

-- 
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | hjp@hjp.at         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (5+ messages)

Message-ID: <20211209195230.c4k2khw5znijnvrl@hjp.at>
Permalink:  ../20211209195230.c4k2khw5znijnvrl@hjp.at/
Also on:    postgresql.org/message-id/20211209195230.c4k2khw5znijnvrl@hjp.at

 · 

reply

Reply instructions:

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

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: hjp-pgsql@hjp.at
  Subject: Re: Detecting repeated phrase in a string
  In-Reply-To: <20211209195230.c4k2khw5znijnvrl@hjp.at>
  References: <CA+i5Jwbe9uH5dwSvV1Ur-zf7VXMCPNsNS20+sBQx4X1Ufr_ANQ@mail.gmail.com> <20211209133510.lkn6vjh5eqpi5csg@hjp.at> <CA+i5JwaEwK=ktV-H-xS2dHgGfWL0RPRDVhcghJ5rQM45DqLY-g@mail.gmail.com> <VisenaEmail.50.2affbb94dee70e79.17d9fba1d20@tc7-visena> <20211209195230.c4k2khw5znijnvrl@hjp.at>

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

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox