title: Get first N array elements from unnest + string_to_array function
body: <p>I would like to access first 5 elements of an array "ingredients" before UNNESTing the array:</p>
  
  <pre><code>SELECT 
      TRIM
      (REGEXP_REPLACE
          (UNNEST
              (string_to_array(ingredients, ';'))[1:5], '\S+\%|\s+\(.*?\)','','g'))
  FROM products 
  </code></pre>
  
  <p>The "Ingredients" array may contain values such as: </p>
  
  <pre><code>{'1%', 'abc(2%)', 'abcd', ... , N th element}
  </code></pre>
  
  <p>The code below works fine but I don't know what's wrong with the above code.</p>
  
  <pre><code>SELECT (string_to_array('1,2,3,4',','))[1:3]
  </code></pre>