Thread: RE: Regular expression question

RE: Regular expression question

From
Michael Ansley
Date:

Yes, that's right :-0  Sorry!

-----Original Message-----
From: Steve Heaven [mailto:steve@thornet.co.uk]
Sent: 11 December 2000 15:09
To: Michael Ansley; pgsql-general@postgresql.org
Subject: RE: [GENERAL] Regular expression question

At 14:58 11/12/00 -0000, Michael Ansley wrote:
>     Hmmm, what I proposed earlier (CREATE INDEX foo ON employees
>(UPPER(firstname));) seems to work fine in 7.1 but not 7.0.2.   Cheers... 
>  MikeA 

I think you're anwering the wrong question.
It was  David  Hancock <DHANCOCK@arinc.com> who was asking the upper/lower
case question. Mine was about a metacharacter for word boundaries cf Perl's
\b.

Steve

--
thorNET  - Internet Consultancy, Services & Training
Phone: 01454 854413
Fax:   01454 854412
http://www.thornet.co.uk

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
Nick West - Global Infrastructure Manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************

RE: Regular expression question

From
Michael Ansley
Date:

Hmmm, what I proposed earlier (CREATE INDEX foo ON employees (UPPER(firstname));) seems to work fine in 7.1 but not 7.0.2.

Cheers...

MikeA


-----Original Message-----
From: Steve Heaven [mailto:steve@thornet.co.uk]
Sent: 11 December 2000 11:10
To: pgsql-general@postgresql.org
Subject: [GENERAL] Regular expression question

Does the regular expression parser have anything equivalent to Perl's \w
word boundary metacharacter?

I want to select tuples where a text field contains a certail whole word.
Using fieldname ~* 'searchword' wont work because it picks up the
searchword emdedded in other words. Using ~*' searchword ' wont find it at
the beginning or end of the string.
So far we have:
 field ~*' searchword ' OR field ~*'^searchword ' OR field ~*' searchword$'
but I would like something more elegant.

Steve

--
thorNET  - Internet Consultancy, Services & Training
Phone: 01454 854413
Fax:   01454 854412
http://www.thornet.co.uk

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
Nick West - Global Infrastructure Manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************

RE: Regular expression question

From
Steve Heaven
Date:
At 14:58 11/12/00 -0000, Michael Ansley wrote:
>     Hmmm, what I proposed earlier (CREATE INDEX foo ON employees
>(UPPER(firstname));) seems to work fine in 7.1 but not 7.0.2.   Cheers...
>  MikeA

I think you're anwering the wrong question.
It was  David  Hancock <DHANCOCK@arinc.com> who was asking the upper/lower
case question. Mine was about a metacharacter for word boundaries cf Perl's
\b.

Steve


--
thorNET  - Internet Consultancy, Services & Training
Phone: 01454 854413
Fax:   01454 854412
http://www.thornet.co.uk