Making substrings uppercase
От | Oliver Kohll - Mailing Lists |
---|---|
Тема | Making substrings uppercase |
Дата | |
Msg-id | 85C3914E-5119-4332-81BD-5C4F0C9DB91E@gtwm.co.uk обсуждение исходный текст |
Ответы |
Re: Making substrings uppercase
Re: Making substrings uppercase |
Список | pgsql-general |
Hello, Given a string with certain words surrounded by stars, e.g. The *quick* *brown* fox jumped over the *lazy* dog can you transform the words surrounded by stars with uppercase versions, i.e. The QUICK BROWN fox jumped over the LAZY dog Given text in a column sentence in table sentences, I can mark/extract the words as follows: SELECT regexp_replace(sentence,'\*(.*?)\*','STARTUPPER\1ENDUPPER','g') FROM sentences; but my first attempt at uppercase transforms doesn't work: select regexp_replace(sentence,'\*(.*?)\*','' || upper('\1'),'g') from sentences; I thought of using substring() to split the parts up after replacing the stars with start and end markers, but that wouldfail if there was more than one word starred. Any other ideas? Oliver
В списке pgsql-general по дате отправления: