The following bug has been logged on the website:
Bug reference: 11211
Logged by: Eduard Wulff
Email address: mail(at)eduard-wulff(dot)de
PostgreSQL version: 9.4beta2
Operating system: Debian testing AMD64
Description:
SELECT vorgangt.id,
(regexp_matches(vorgangt.text, '#\w{5,26}', 's'))[1] AS sernr,
regexp_replace(vorgangt.text, '\n', '⁋', 'g') AS text_in_einer_zeile
FROM vorgangt ORDER BY 1
This works to get the first match if there is one.
BUT: it also _eliminates_ all rows that do not match from the result set
EXPECTED: return NULL or at least an empty string if there is no match