Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to do a regular expression search using ~ in PostgreSQL? #148

Closed
fooo19 opened this issue Feb 6, 2023 · 2 comments
Closed
Labels

Comments

@fooo19
Copy link

fooo19 commented Feb 6, 2023

I would like to achieve regular expression searches by using PostgreSQL.
In PostgreSQL, I can search with the following query.

SELECT * FROM table WHERE id ~ '.*';

I have looked into the possibility of achieving this with reference to ticket #31, but '~' is an operator, so criteriaBuilder.function() cannot be used.
#31

Is there any way to make this happen?

@darrachequesne
Copy link
Owner

Hi! I guess you already know it, but Postgresql 15 now has a regexp_like() method.

Reference: https://www.postgresql.org/docs/15/functions-matching.html

For previous versions, I'm not sure whether it's possible.

@darrachequesne
Copy link
Owner

Closed due to inactivity, please reopen if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants