Retrieve list of matched words in PostgreSQL
What about using the regexp_split_to_table function?

SELECT regexp_split_to_table(ts_headline('the big red ball'::text , 'big &amp; ball'),' ');
 regexp_split_to_table 
-----------------------
 the
 &lt;b&gt;big&lt;/b&gt;
 red
 &lt;b&gt;ball&lt;/b&gt;
(4 rows)