File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ defmodule Regex do
127127
128128 captures =
129129 case Keyword . get ( options , :capture , :all ) do
130- :groups -> groups || raise "regex was not compiled with g"
130+ :groups -> groups || raise ArgumentError , message: "regex was not compiled with g"
131131 others -> others
132132 end
133133
@@ -139,6 +139,7 @@ defmodule Regex do
139139
140140 @ doc """
141141 Returns the given captures as a list of tuples.
142+ Requires the regex to be compiled with the groups option.
142143
143144 ## Examples
144145
@@ -150,7 +151,7 @@ defmodule Regex do
150151 captures = if groups do
151152 Enum . sort ( groups )
152153 else
153- raise "Regex was not compiled with g"
154+ raise ArgumentError , message: "regex was not compiled with g"
154155 end
155156 options = Keyword . put ( options , :capture , captures )
156157 end
@@ -159,7 +160,7 @@ defmodule Regex do
159160 end
160161
161162 @doc """
162- Returns the underlying re_pattern in the regular expression .
163+ Returns the underlying ` re_pattern` in the regular expression .
163164 "" "
164165 def re_pattern(regex(re_pattern: compiled)) do
165166 compiled
You can’t perform that action at this time.
0 commit comments