Re: regular expression question

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Joel Rodrigues <borgempath(at)Phreaker(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: regular expression question
Date: 2003-06-04 20:00:31
Message-ID: 20030604200031.GA16777@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Jun 05, 2003 at 00:10:18 +0530,
Joel Rodrigues <borgempath(at)Phreaker(dot)net> wrote:
> Hi,
> I'm trying to write a check on a column restricting the data to
> numerals from 0-9, commas, dashes '-' and single spaces. To
> allow the entry of something like "134-140, 310-312".
>
> I seem to have got everything but the single spaces.
>
> '^[0-9|,-]{0,10}$'

How about:
'^[-0-9, ]*$'

In response to

Browse pgsql-general by date

  From Date Subject
Next Message scott.marlowe 2003-06-04 20:28:14 Re: Nulls get converted to 0 problem
Previous Message Jim C. Nasby 2003-06-04 19:56:11 Re: regular expression question