You cannot use regex macros in exception because of bootstrap reasons (exception.ex is compiled before regex.ex). You can use `:re.compile` though. If you still want the regex compiled at "compile-time" something like this should work:

```elixir
{ :ok, regex } = :re.compile("my_regex", [:extended]
def function_name_pattern, do: unquote(regex)
```