How about:

db(db.tabla.longstr.regexp(regexp)).select(db.tabla.id, db.tabla.name,
                                           "regexp_matches(tabla.longstr, 
'%s', 'g')" % regexp)

Anthony

On Monday, January 29, 2018 at 8:32:57 AM UTC-5, Pierre wrote:
>
>
> hello everyone,
>
>
> Is it possible to integrate a postgresql* regexp_matches* to a dal 
> expression query ?  
>
> raw SQL working example: 
>
> query = "SELECT tabla.id, tabla.name, regexp_matches(tabla.longstr, '%s', 
> 'g') FROM tabla WHERE (tabla.longstr ~ '%s');" %(regexp,regexp)
>
>
> ref: https://www.postgresql.org/docs/9.0/static/functions-matching.html
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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.

Reply via email to