File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -5554,7 +5554,7 @@ defmodule Kernel do
55545554 quote ( do: List . to_charlist ( unquote ( unescape_list_tokens ( pieces ) ) ) )
55555555 end
55565556
5557- @ doc """
5557+ @ doc ~S """
55585558 Handles the sigil `~r` for regular expressions.
55595559
55605560 It returns a regular expression pattern, unescaping characters and replacing
@@ -5564,12 +5564,15 @@ defmodule Kernel do
55645564
55655565 ## Examples
55665566
5567- iex> Regex.match?(~r( foo) , "foo")
5567+ iex> Regex.match?(~r/ foo/ , "foo")
55685568 true
55695569
55705570 iex> Regex.match?(~r/a#{:b}c/, "abc")
55715571 true
55725572
5573+ While the `~r` sigil allows parens and brackets to be used as delimiters,
5574+ it is preferred to use `"` or `/` to avoid escaping conflicts with reserved
5575+ regex characters.
55735576 """
55745577 defmacro sigil_r ( term , modifiers )
55755578
You can’t perform that action at this time.
0 commit comments