Re: DIFFERENCE BETWEEN LIKE AND SIMILAR OPERATORS

From: John Gage <jsmgage(at)numericable(dot)fr>
To: JORGE MALDONADO <jorgemal1960(at)gmail(dot)com>, pgsql-novice(at)postgresql(dot)org
Subject: Re: DIFFERENCE BETWEEN LIKE AND SIMILAR OPERATORS
Date: 2010-03-16 05:27:40
Message-ID: 4457A26F-1A8F-42BB-8F57-19E9FF1842A2@numericable.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

"Standard" regular expressions are extremely well supported in
Postgres and are one of the main reasons I use Postgres. I strongly,
very strongly, recommend plunging into regular expressions as deeply
as you can. Once you start using them "regularly" you will be unable
to live without them. They are built into the Vim editor which is
also a must have. Like regular expressions, once you have used Vim
for awhile, you absolutely can't go back.

John

On Mar 16, 2010, at 2:31 AM, Bruce Momjian wrote:

> JORGE MALDONADO wrote:
>> I've been reading PostgreSQL documentation and I do not really
>> understand
>> the difference between LIKE and SIMILAR operators. Can someone
>> explain?
>
> SIMILAR is a super-set of LIKE syntax. Our docs have:
>
> http://developer.postgresql.org/pgdocs/postgres/functions-matching.html#FUNCTIONS-SIMILARTO-REGEXP
>
> It is similar to LIKE, except that it interprets the pattern using
> the
> SQL standard's definition of a regular expression. SQL regular
> expressions are a curious cross between LIKE notation and common
> regular
> expression notation.
>
> For the super-set, see the bullets below this line:
>
> In addition to these facilities borrowed from LIKE, SIMILAR TO
> supports these pattern-matching metacharacters borrowed from POSIX
> regular expressions:
>
> --
> Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
> EnterpriseDB http://enterprisedb.com
>
> PG East: http://www.enterprisedb.com/community/nav-pg-east-2010.do
>
> --
> Sent via pgsql-novice mailing list (pgsql-novice(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-novice

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Jasen Betts 2010-03-16 08:51:31 Re: PostgreSQL questions
Previous Message Bruce Momjian 2010-03-16 01:31:43 Re: DIFFERENCE BETWEEN LIKE AND SIMILAR OPERATORS