Re: Regex for Word space Word space Word ....

Поиск
Список
Период
Сортировка
От
Тема Re: Regex for Word space Word space Word ....
Дата
Msg-id YZzydgLNjRiEXmkX@tuxteam.de
обсуждение исходный текст
Ответ на Regex for Word space Word space Word ....  (Shaozhong SHI <shishaozhong@gmail.com>)
Список 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

Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: Дмитрий Иванов
Дата:
Сообщение: Re: PQexecParams, placeholders and variable lists of params
Следующее
От: tomas@tuxteam.de
Дата:
Сообщение: Re: PQexecParams, placeholders and variable lists of params