Re: Regex for Word space Word space Word .... - Mailing list pgsql-general

From
Subject Re: Regex for Word space Word space Word ....
Date
Msg-id YZzydgLNjRiEXmkX@tuxteam.de
Whole thread Raw
In response to Regex for Word space Word space Word ....  (Shaozhong SHI <shishaozhong@gmail.com>)
List pgsql-general
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

Attachment

pgsql-general by date:

Previous
From: Дмитрий Иванов
Date:
Subject: Re: PQexecParams, placeholders and variable lists of params
Next
From: tomas@tuxteam.de
Date:
Subject: Re: PQexecParams, placeholders and variable lists of params