Json to custom Column with "Regex extract"

Hi Guys,

I try to create Custom Column from a JSON (inside a Column) with a Custom Column.

I did write a short regex to extract the Value I need from the JSON in a separate Column.

Here the Code:
(?<=status":.")(.*?(?="))
image

I also tried
"/(?<=status":.")(.?(?="))/gm"
"(?<=status":.")(.
?(?="))"

Writing it differently etc. but Metabase just don't work with it. It is always this error Message:

Metabase Error:
image

any idea what I can do? I checked the regex 10x, it works perfectly for every case I have, it just doesn't work in metabase :(.

Cheers and thanks for your input!

Hi @THFree
You cannot use full regex like that - you might be seeing this issue:
https://github.com/metabase/metabase/issues/14517 - upvote by clicking :+1: on the first post
But I would highly recommend using a view to expand your JSON columns - it's much more efficient, since it's handled by the database and can even be indexed.

1 Like

Hi, didn't use Metabase that long, so maybe sorry for that Noob-Question ;).

What do you mean by "view to expand your JSON columns" ?

@THFree It has nothing to do with Metabase. That depends on your database. Example Postgres:
https://stackoverflow.com/questions/45661639/extract-and-expand-postgres-json-column-data-into-separate-table