Hi,
Is it possible to replace multiple regex patterns in a string in one pass? Basically, I want to combine the two replaces below into a single pass over the string
str |> String.replace(~r/^\s+/, "") |> String.replace(~r/\s+$/, ":")
I see https://hexdocs.pm/elixir/Regex.html#replace/4 has an optional function, but it looks like it’s not suitable for distinguishing between spaces at the beginning of the string and spaces at the end of the string.