How to get a word from a certain letter inside a String in Postgres

Asked

Viewed 28 times

0

I’m trying to get a word from a certain letter inside a String in Postgres. I’ve tried several ways, but I haven’t succeeded using substring, strpos

In the select below, I need to pick up the words that are inside the tag < em >.

Example:

SELECT HISTORICO_MSG FROM TABELA_TESTE

Upshot:

Campo: <em>Curso de Java<\/em> conteúdo alterado de <em>Listas[id=E]<\/em> para <em>Collections [id=N]<\/em>.<br>
  • 1

    Have you searched for regular expression functions? https://www.postgresql.org/docs/current/functions-matching.html

  • I tried some regex functions but never had contact with it and I’m having difficulties using it. I thought there might be something simple for this like substring(HISTORICO_MSG from '<em>. </em>')

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.