Re: Quick Regex Question

From: Howard Cole <howardnews(at)selestial(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Quick Regex Question
Date: 2007-12-20 11:37:17
Message-ID: 476A53ED.1040706@selestial.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Howard Cole wrote:
> Martijn van Oosterhout wrote:
>> On Thu, Dec 20, 2007 at 11:51:34AM +0100, A. Kretschmer wrote:
>>
>>> am Thu, dem 20.12.2007, um 10:36:08 +0000 mailte Howard Cole
>>> folgendes:
>>>
>>>> Your expression works fine Richard, as does '(^| )ho', but can you
>>>> tell me why '[ ^]ho' doesn't work?
>>>>
>>> With ^ you means an anchor, but within the brackets it's a simple char.
>>>
>>
>> Err no, it inverts the test. [^ ] means any character *except* a space.
>>
>> Have a nice day,
>>
> 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, or am I forced to use the (^| ) syntax?
>
> Is it just me or are regular expressions crazy?
>
> 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
>
Sorry - I have just read the relevant section of the manual again and it
is starting to make sense. I shall use the (^| ) syntax as suggested.
Thanks for all the help.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2007-12-20 11:44:42 Re: foreign key constraint, planner ignore index.
Previous Message Howard Cole 2007-12-20 11:18:10 Re: Quick Regex Question