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
127
127
128
128
captures =
129
129
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"
131
131
others -> others
132
132
end
133
133
@@ -139,6 +139,7 @@ defmodule Regex do
139
139
140
140
@ doc """
141
141
Returns the given captures as a list of tuples.
142
+ Requires the regex to be compiled with the groups option.
142
143
143
144
## Examples
144
145
@@ -150,7 +151,7 @@ defmodule Regex do
150
151
captures = if groups do
151
152
Enum . sort ( groups )
152
153
else
153
- raise "Regex was not compiled with g"
154
+ raise ArgumentError , message: "regex was not compiled with g"
154
155
end
155
156
options = Keyword . put ( options , :capture , captures )
156
157
end
@@ -159,7 +160,7 @@ defmodule Regex do
159
160
end
160
161
161
162
@doc """
162
- Returns the underlying re_pattern in the regular expression .
163
+ Returns the underlying ` re_pattern` in the regular expression .
163
164
"" "
164
165
def re_pattern(regex(re_pattern: compiled)) do
165
166
compiled
You can’t perform that action at this time.
0 commit comments