Follow

I spent too much time in the night pondering a simple way to sort out some data I'm working with. Now I find that there's no REGEXP function in Sqlite that one can use in the select clause?!

@samwilson looks like you can load a library to provide a user defined one? i don't *think* i've actually tried this...

@brennen So far, all I've found is docs about loading a user-defined one that can only be used in the WHERE clause, and not for selecting. What I want to do is chop up a field into various parts, and use those parts elsewhere in the query.

@brennen hehe, well… it's a filename deep within a JSON field. I've pulled it out of that though (huzza for `json_each()`) and now want to extract a few bits of info out of the filename (e.g. the integer in `/.*No_?([0-9]+).*/`).

@samwilson ah, gotcha. that's a kind of string mangling i tend to do at the perl/python/php level, but it feels like there *ought* to be a way to do it in a query.

@brennen yeah, it looks like I'm heading back to PHP for it. At least then I'll be able to do some other things like open the files for other checking. I just liked the idea of a single SQL query solving all my problems at once!

Sign in to participate in the conversation
Aus GLAM Space

This is a Mastodon instance primarily for Australasian Galleries, Libraries, Archives, Museums and Records people, and anyone else who wants to hang out with them. We use the Hometown fork which enables local-only posts.