From: tomas@tuxteam.de
To: pgsql-general@lists.postgresql.org
Subject: Re: Regex for Word space Word space Word ....
Date: Tue, 23 Nov 2021 14:53:58 +0100
Message-ID: <YZzydgLNjRiEXmkX@tuxteam.de> (raw)
In-Reply-To: <CA+i5JwYnphk2jfa8yUxmQsJmgmmYP=N08yMm=MmsJopW667sKQ@mail.gmail.com>
References: <CA+i5JwYnphk2jfa8yUxmQsJmgmmYP=N08yMm=MmsJopW667sKQ@mail.gmail.com>
On Tue, Nov 23, 2021 at 09:58:00AM +0000, Shaozhong SHI wrote:
> Is there any regex for Word space Word space Word and more?
It isn't very clear what you want to achieve. From the other mails in
this thread I understand that your words start with an uppercase char
and continue with lowercase chars. Is that right?
You want exactly one space between words, or more than one?
What is this "...and more"? Arbitrary repetitions?
Which kind of regular expressions do you want to use? POSIX?
If all the answers to the above are "yes", you might try something like
"(?:[[:upper:]][[:lower:]]*[[:space:]]+)*[[:upper:]][[:lower:]]*"
(Caveat: untested). This would match a single word or more than one
word, separated by one or more spaces, where a word starts with one
upper-case character and continues with zero or more lowercases.
HTH
- t
Attachments:
signature.asc (application/pgp-signature, 194B) download
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: tomas@tuxteam.de
Subject: Re: Regex for Word space Word space Word ....
In-Reply-To: <YZzydgLNjRiEXmkX@tuxteam.de>
References: <CA+i5JwYnphk2jfa8yUxmQsJmgmmYP=N08yMm=MmsJopW667sKQ@mail.gmail.com> <YZzydgLNjRiEXmkX@tuxteam.de>
* 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