diff --git a/deps/rabbitmq_cli/lib/rabbitmq/cli/core/command_modules.ex b/deps/rabbitmq_cli/lib/rabbitmq/cli/core/command_modules.ex index bc9189092e16..ea751b4f4991 100644 --- a/deps/rabbitmq_cli/lib/rabbitmq/cli/core/command_modules.ex +++ b/deps/rabbitmq_cli/lib/rabbitmq/cli/core/command_modules.ex @@ -11,7 +11,7 @@ defmodule RabbitMQ.CLI.Core.CommandModules do import RabbitMQ.CLI.Core.CodePath - @commands_ns ~r/RabbitMQ.CLI.(.*).Commands/ + @commands_ns ~S"RabbitMQ.CLI.(.*).Commands" def module_map(opts \\ %{}) do Application.get_env(:rabbitmqctl, :commands) || load(opts) @@ -130,7 +130,7 @@ defmodule RabbitMQ.CLI.Core.CommandModules do end defp make_module_map(modules, scope) when modules != nil do - commands_ns = Regex.recompile!(@commands_ns) + commands_ns = Regex.compile!(@commands_ns) modules |> Enum.filter(fn mod -> @@ -212,7 +212,7 @@ defmodule RabbitMQ.CLI.Core.CommandModules do defp command_scopes(cmd) do case CommandBehaviour.scopes(cmd) do nil -> - Regex.recompile!(@commands_ns) + Regex.compile!(@commands_ns) |> Regex.run(to_string(cmd), capture: :all_but_first) |> List.first() |> to_snake_case diff --git a/deps/rabbitmq_cli/lib/rabbitmq/cli/core/os_pid.ex b/deps/rabbitmq_cli/lib/rabbitmq/cli/core/os_pid.ex index 838775ddba6e..7c850dc28628 100644 --- a/deps/rabbitmq_cli/lib/rabbitmq/cli/core/os_pid.ex +++ b/deps/rabbitmq_cli/lib/rabbitmq/cli/core/os_pid.ex @@ -7,7 +7,7 @@ defmodule RabbitMQ.CLI.Core.OsPid do @external_process_check_interval 1000 - @pid_regex ~r/^\s*(?\d+)/ + @pid_regex ~S"^\s*(?\d+)" # # API @@ -27,7 +27,7 @@ defmodule RabbitMQ.CLI.Core.OsPid do def read_pid_from_file(pidfile_path, should_wait) do case {:file.read_file(pidfile_path), should_wait} do {{:ok, contents}, _} -> - pid_regex = Regex.recompile!(@pid_regex) + pid_regex = Regex.compile!(@pid_regex) case Regex.named_captures(pid_regex, contents)["pid"] do # e.g. the file is empty