Re: regular expression question

From: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>
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:29:57
Message-ID: Pine.LNX.4.33.0306041429010.16396-100000@css120.ihs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 5 Jun 2003, Joel Rodrigues 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}$'

Try this:

'^[[:digit:][:space:],-]{0,10}$'

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2003-06-04 20:31:02 Re: libpgeasy.h and 7.3.2
Previous Message scott.marlowe 2003-06-04 20:28:14 Re: Nulls get converted to 0 problem