Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

164
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda