It's not Elixir, but you might be interested in F#'s active patterns, particularly the parameterized active patterns: https://learn.microsoft.com/en-us/dotnet/fsharp/language-ref...
F#'s active patterns allow you to extend the built-in pattern matching to other things, and in this case, you can have patterns that return regular expression matches.