File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -471,8 +471,7 @@ defmodule Regex do
471
471
end
472
472
473
473
@ doc ~S"""
474
- Same as `run/3`, but scans the target several times collecting all
475
- matches of the regular expression.
474
+ Same as `run/3` but returns all non-overlapping matches of the regular expression.
476
475
477
476
A list of lists is returned, where each entry in the primary list represents a
478
477
match and each entry in the secondary list represents the captured contents.
@@ -497,6 +496,12 @@ defmodule Regex do
497
496
iex> Regex.scan(~r/e/, "abcd")
498
497
[]
499
498
499
+ iex> Regex.scan(~r/ab|bc|cd/, "abcd")
500
+ [["ab"], ["cd"]]
501
+
502
+ iex> Regex.scan(~r/ab|bc|cd/, "abbccd")
503
+ [["ab"], ["bc"], ["cd"]]
504
+
500
505
iex> Regex.scan(~r/\p{Sc}/u, "$, £, and €")
501
506
[["$"], ["£"], ["€"]]
502
507
You can’t perform that action at this time.
0 commit comments