How to pipe the results of Enum.join into Regex.scan in Elixir?
<p>From the docs on pipe operator, I see "The |> symbol used in the snippet above is the pipe operator: it simply takes the output from the expression on its left side and passes it as the first argument to the function call on its right side.".  </p>

<p>But if I have a string that I split, then join it and want to feed that joined string into Regex.scan below, how do I do it?  I get a compiled error <em>unhandled &amp;1 outside of a capture</em> when I try to run the below...And I think this is due to my lack of understanding on how to capture a pipe operator output and use it as an argument.</p>

<pre><code>string
|&gt; String.split(" ")  
## some other operations here to operate on split string omitted for clarity
|&gt; Enum.join
|&gt; Regex.scan(~r/[A-Z]/, &amp;1)
|&gt; List.flatten
|&gt; Enum.join
</code></pre>