PassiveSupport.String.scan
You're seeing just the function
scan
, go back to PassiveSupport.String module for more information.
Link to this function
scan(string, pattern, opts \\ [])
Specs
Converts the provided pattern to a regular expression, if necessary,
and then invokes Regex.scan
on the expression and the string.
Useful for invoking regular expressions on strings in the middle of transformation pipelines.
Examples
iex> scan("footwear, fun, and fondue", "((f[ou])[no]).+")
[["footwear, fun, and fondue", "foo", "fo"]]
iex> scan("fööd!", "öö")
[["öö"]]
iex> scan("footwear, fun, and fondue", ~r/((f[ou])[no]).+/U)
[["foot", "foo", "fo"], ["fun,", "fun", "fu"], ["fond", "fon", "fo"]]