Hello, jOOQ doesn't have anything like that built in, but it would certainly make sense to add it. There's already DSL.escape(), which can be used for usage with the LIKE operator. I've added a feature request for this. https://github.com/jOOQ/jOOQ/issues/4690
In the meantime, you'll have to resort to quoting your input directly yourself - either in Java, or in the database. An example can be seen here: http://cwestblog.com/2012/07/10/postgresql-escape-regular-expressions Hope this helps, Lukas 2015-10-21 14:55 GMT+02:00 <[email protected]>: > In Java the method Pattern.quote("weir(d) string") quotes the string to > ensure a valid Regex. > > In my case I have to use an user input for a likeRegex call and I am > looking for a similar method, so the user cannot break the regex. > We are using Postgres which uses the Posix Regex syntax. > > What is the best way to achieve this? Thanks! > > -- > You received this message because you are subscribed to the Google Groups > "jOOQ User Group" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "jOOQ User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
