I want to get the data from a database table using a regular expression.This is what i did:
def getDataRegExp(term: String): Seq[User] ={
DB.withConnection(
implicit connection =>
SQL("select * from user where pseudo ~ '^{term}'").on(
'term -> term
).as(User.simple *)
)
}
But i get nothing in result.
What I’m doing wrong?
PS: I’m using PostgreSQL 9.1
Well I succeded in getting a result. It gives me all the user that contains the inserted
term. I have just deleted'and^that were surrounding{term}. Here is the code.