Phoenix path validation?

You might do it in your controller maybe.

For checking that it’s an integer

def show(conn, %{"dept_id" => dept_id}) when is_integer(dept_id) do
  ...
end

For regex stuff this thread might be helpful Simulate Regex match guards in functions