Replies: 1 comment 3 replies
-
That result is what I expect. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The following:
#!/bin/ruby
require 'sequel'
DB = Sequel.sqlite('/data/abn/abn.db',
after_connect: proc do|db|
db.enable_load_extension(true)
db.load_extension('./sqlite/regexp.so')
end
)
Items = DB[:main]
pp Items.select{regexp_substr('the year is 2021', '[0-9]+')}.first
=== end of program
returns:
{:"regexp_substr('the year is 2021', '[0-9]+')"=>"2021"}
The SQL is 👍
Sequel::SQLite::Dataset: "SELECT regexp_substr('the year is 2021', '[0-9]+') FROM
main
"If I run that in the Sqlite CLI, I get
2021
Han Holl
(I wasn't quite sure if this is a new discussion)
(And how do I get the nice syntax coloring?)
Beta Was this translation helpful? Give feedback.
All reactions