Re: Quick Regex Question - Mailing list pgsql-general

From Terry Fielder
Subject Re: Quick Regex Question
Date
Msg-id 476A5908.8010404@ashtonwoodshomes.com
Whole thread Raw
In response to Re: Quick Regex Question  (Howard Cole <howardnews@selestial.com>)
Responses Re: Quick Regex Question
List 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
>

pgsql-general by date:

Previous
From: Richard Huxton
Date:
Subject: Re: foreign key constraint, planner ignore index.
Next
From: Howard Cole
Date:
Subject: Re: Quick Regex Question