> Am 16.05.2018 um 09:10 schrieb Torsten Förtsch :
>
> select array_agg(i[1]) as e from regexp_matches( 'H2O',
> '[0-9]*[A-Z][a-z]?\d*|\((?:[^()]*(?:\(.*\))?[^()]*)+\)\d+', 'g') t(i);
perfect, this helps with the t(i) call
Phil
signature.asc
Description: Message signed with OpenPGP using GPG
On Wed, May 16, 2018 at 8:14 AM, Philipp Kraus <
philipp.kr...@tu-clausthal.de> wrote:
> Hello,
>
> I have got a function with a reg expr to split chemical formulas e.g. H2O
> -> H2 O.
>
> CREATE OR REPLACE FUNCTION daimon.text2sumformula(text) RETURNS text[] AS
> $$
> select array_agg(i::text
Hi
2018-05-16 8:14 GMT+02:00 Philipp Kraus :
> Hello,
>
> I have got a function with a reg expr to split chemical formulas e.g. H2O
> -> H2 O.
>
> CREATE OR REPLACE FUNCTION daimon.text2sumformula(text) RETURNS text[] AS
> $$
> select array_agg(i::text) as e from ( select unnest( regexp_match
Hello,
I have got a function with a reg expr to split chemical formulas e.g. H2O -> H2
O.
CREATE OR REPLACE FUNCTION daimon.text2sumformula(text) RETURNS text[] AS $$
select array_agg(i::text) as e from ( select unnest( regexp_matches( $1,
'[0-9]*[A-Z][a-z]?\d*|\((?:[^()]*(?:\(.*\))?[^()]*)