I have 2 tables in Redshift, one of them has a column containing Regex strings. And I want to join them like so:

```
select *
from one o
join two t
on o.value ~ t.regex

```

But this query throws an error:

```
[Amazon](500310) Invalid operation: The pattern must be a valid UTF-8 literal character expression
Details: 
 -----------------------------------------------
  error:  The pattern must be a valid UTF-8 literal character expression
  code:      8001
  context:   
  query:     412993
  location:  cgx_impl.cpp:1911
  process:   padbmaster [pid=5211]
  -----------------------------------------------;

```

As far as I understood from searching in the docs, the right side of a regex operator `~` must be a string literal.

So this would work:

```
select *
from one o
where o.value ~ 'regex'

```

And this would fail:

```
select *
from one o
where 'regex' ~ o.value

```

Is there any way around this? Anything I missed?

Thanks!