Re: Quick Regex Question

From: Terry Fielder <terry(at)ashtonwoodshomes(dot)com>
To: Howard Cole <howardnews(at)selestial(dot)com>
Cc: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Quick Regex Question
Date: 2007-12-20 11:59:04
Message-ID: 476A5908.8010404@ashtonwoodshomes.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


<Snip>
Howard Cole wrote:
>>
> Hi Marijn, Andreas,
>
> I think Andreas is right, note the ordering of characters in the above
> example as [ ^] rather than [^ ].
> So if the '^' is taken as literal '^', can I check for the beginning
> of a string in the brackets,
Why do you need to? Check for the beginning of the string BEFORE the
set brackets. The point of set brackets is "match from a set of
chars". Since "beginning of string" can only match one place, it has no
meaning as a member of a set. Or in other words, if it has meaning, it
needs to be matched FIRST out of the set, and therefore you can just
remove from the set and put before the set brackets.
> or am I forced to use the (^| ) syntax?

>
> Is it just me or are regular expressions crazy?
Complicated, not crazy.

Terry

>
> Howard
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
> choose an index scan if your joining column's datatypes do not
> match
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Marek Szczypek 2007-12-20 12:24:25 Change of the data directory on Ubuntu 7.04
Previous Message Richard Huxton 2007-12-20 11:44:42 Re: foreign key constraint, planner ignore index.