 results in too many values,
it may overflow the maximum number of values
that can be returned by a Lua function.
In this case,
we should collect these values in a table:
</p>
<pre class="example">
function split (s, sep)
  sep = lpeg.P(sep)
  local elem = lpeg.C((1 - sep)^0)
  local p = lpeg.Ct(elem * (sep * elem)^0)   -- make a table capture
  return lpeg.match(p, s)
end
</pre>


<h3>Searching for a pattern</h3>
<p>
The primitive <code>match</code> works only in anchored mode.
If we want to find a pattern