I have the following statement in Rails 3 using an SQLite3 database:
word = \'Hello\' word_entry = Word.where(\"name REGEXP :word\", {:word => \"[[:<:]
From source of sqlite3_ar_regexp project, I extract this:
db = SQLite3::Database.open( database_name ) db.create_function('regexp', 2) do |func, pattern, expression| func.result = expression.to_s.match( Regexp.new(pattern.to_s, Regexp::IGNORECASE)) ? 1 : 0 end