elixir-lang/elixir — pull request #2320 by alco (2014-05-22 15:57:05+00:00)
Title: Draft implementation of custom inspect algorithm for regexes

This is a sketch of my ideas for #2250.

Do we need it to be smarter? I.e., choose different delimiters based on the contents of the source.

```
iex(1)> ~r"\d+\n"
~r/\d+\n/

iex(2)> ~r"\d+/\n"
~r/\d+\/\n/

iex(3)> ~r"\a\d+/\n"
~r/\a\d+\/\n/

iex(4)> Regex.compile!("\a\\d+/\n")
~r/\a\d+\/\n/

iex(5)> Regex.compile!("\a\d+/\n")
~r/\a\177+\/\n/

iex(6)> Regex.compile!("\a\x{fe34}+/\n")
~r/\a︴+\/\n/
```