We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e208237 commit 0fa06a2Copy full SHA for 0fa06a2
lib/elixir/lib/regex.ex
@@ -327,10 +327,12 @@ defmodule Regex do
327
end
328
329
330
+ { :ok, pattern } = :re.compile(%B"\(\?<(?<G>[^>]*)>")
331
+ @groups_pattern pattern
332
+
333
defp parse_groups(source) do
334
options = [:global, {:capture, ['G'], :binary}]
- {:ok, pattern} = :re.compile(%B"\(\?<(?<G>[^>]*)>")
- case :re.run(source, pattern, options) do
335
+ case :re.run(source, @groups_pattern, options) do
336
:nomatch -> []
337
{ :match, results } ->
338
lc [group] inlist results, do: binary_to_atom(group)
0 commit comments