How to allow null as an option when using regexp_matches?

From: Shaozhong SHI <shishaozhong(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: How to allow null as an option when using regexp_matches?
Date: 2021-12-08 12:07:13
Message-ID: CA+i5JwYMPY1PwACzD4tLn0PdXuyRXBF9x+d38QfzJ1kMkRet5A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

We can do this:
select count(*) from regexp_matches('Great London', 'Great
London|Information Centre|Department for Transport', 'g');

Is it possible to allow null as an option? something like this
select count(*) from regexp_matches('Great London', 'null|Great
London|Information Centre|Department for Transport', 'g');

Regards,

David

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Karsten Hilbert 2021-12-08 12:09:54 Re: How to allow null as an option when using regexp_matches?
Previous Message Peter J. Holzer 2021-12-08 11:03:36 Re: Working with fixed-point calculations in C