Re: A function to count all ocurrences of a character within a string. - Mailing list pgsql-sql

From bricklen
Subject Re: A function to count all ocurrences of a character within a string.
Date
Msg-id AANLkTimkG6PrtaS7MQ8qxEuMRLFre6ZxOXtgfApb+OgE@mail.gmail.com
Whole thread Raw
In response to A function to count all ocurrences of a character within a string.  (Piotr Czekalski <pczekalski@techbaza.pl>)
Responses Re: A function to count all ocurrences of a character within a string.  ("Ross J. Reedstrom" <reedstrm@rice.edu>)
List pgsql-sql
On Mon, Mar 7, 2011 at 1:20 PM, Piotr Czekalski <pczekalski@techbaza.pl> wrote:
> 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

Couple examples here that might help to get you started
http://www.postgres.cz/index.php/PostgreSQL_SQL_Tricks#Get_count_of_substrings_in_string


pgsql-sql by date:

Previous
From: Piotr Czekalski
Date:
Subject: A function to count all ocurrences of a character within a string.
Next
From: "Ross J. Reedstrom"
Date:
Subject: Re: A function to count all ocurrences of a character within a string.