From: Piotr Czekalski <pczekalski@techbaza.pl>
To: pgsql-sql@postgresql.org
Subject: A function to count all ocurrences of a character within a string.
Date: Mon, 07 Mar 2011 22:20:14 +0100
Message-ID: <4D754C0E.4030804@techbaza.pl> (raw)
Hello pgsql community,
Is there any string function (other than regex / scan & compare loop) to
obtain a list (or even a count) of characters within a string?
strpos and position seems to return only first occurence of a
char/string within substring.
The goal is to check if a string contains equal number of opening and
closing parenthesis, and if there are any of them.
Regards,
Piotr Czekalski
--
--------------------------------------------------------------
"TECHBAZA.PL" Sp. z o.o.
Technologie WEB, eDB& eCommerce
tel. (+4832) 7186081
fax. (+4832) 7003289
email: biuro@techbaza.pl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: pczekalski@techbaza.pl
Subject: Re: A function to count all ocurrences of a character within a string.
In-Reply-To: <4D754C0E.4030804@techbaza.pl>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox