Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > sqlite regexp support

Thread Tools

sqlite regexp support

Rolando Abarca
Posts: n/a
What's the Right Way(tm) to implement regexp support in sqlite?
I'm doing this, but apparently it's not working:

db ="test.db")
db.results_as_hash = true
db.create_function('regexp', 2) do |func, v1, v2|
r =
if v2.to_s.match(r)
func.result = true
func.result = false

and i'm running a query like this:

select * from table where column REGEXP '(www\.)?'

any hints?
what should return the regexp function?

Rolando Abarca
Phone: +56-9 97851962
My Amazon Wish List:

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[regexp] How to convert string "/regexp/i" to /regexp/i - ? Joao Silva Ruby 16 08-21-2009 05:52 PM
Ruby sqlite/gem error: Could not load sqlite adapter Ruby 4 04-18-2009 12:53 AM
Re: Does Python 2.5.2's embedded SQLite support full text searching? Daniel Fetchinson Python 3 04-22-2008 04:27 PM
Does Python 2.5.2's embedded SQLite support full text searching? Python 0 04-21-2008 04:10 PM
Installing sqlite-ruby when sqlite is in non-standard location Carl Youngblood Ruby 1 04-09-2005 03:32 AM