Re: Regex Query Index question

From: David Johnston <polobo(at)yahoo(dot)com>
To: David Johnston <polobo(at)yahoo(dot)com>
Cc: Naoko Reeves <naokoreeves(at)gmail(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Regex Query Index question
Date: 2011-08-11 23:58:08
Message-ID: B1D22FDB-8AB1-4C74-AE54-1D91C91C669C@yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


>
> Not testing here but... and ignore whitespace
>
> '^( [ \[\( ]? \s* \d{3} \s* [ -\s\]\) ] \d{3} [ -\s ] \d{4} )$'
>
Some tweaks needed but seriously consider dropping RegEx and going the functional index route.

> '^( [ \[\( ]? \s* \d{3} \s* [ -\s\]\) ] \s* \d{3} \s* [ -\s ] \s* \d{4} )$'

Added some extra white-space checking but again not tested.

You can probably find better/more flexible expressions online.

David J.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rich Shepard 2011-08-12 00:00:32 Re: COPY from .csv File and Remove Duplicates
Previous Message Tom Lane 2011-08-11 23:54:37 Re: Regex Query Index question