Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

159
Visualizações
How to use SIMILAR TO or Posix in Knex for Postgres?

Postgres supports SIMILAR TO and POSIX regular expressions allowing writing more powerful regular expressions than the LIKE operator does. https://www.postgresql.org/docs/7.3/functions-matching.html

I am using Knex to run queries on a Postgres database. I know how to use LIKE with knex but I could not find the support for SIMILAR TO or POSIX regular expressions.

How can I use SIMILAR TO with knex or even better the POSIX expressions?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I found the support for POSIX. It seems the SIMILAR TO operator is not supported. However, that is okay as POSIX allows to write more powerful regex than SIMILAR TO.

 .where('column', '~', 'pattern');

~: case sensitive match

~*: case-insensitive match

!~ and !~* negation of the corresponding operator.

https://github.com/knex/knex/pull/562/files

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda