Re: [GENERAL] Quick Regex Question

2007-12-20 Thread Alvaro Herrera
Howard Cole wrote: > Hmm. Still think they are crazy - sometimes the characters are interpreted > as literals - other times not? Thats crazy in my book! Yeah. ^, like a lot of other chars, means different things when at the beggining of a [] (where it means "negate the character class") than an

Re: [GENERAL] Quick Regex Question

2007-12-20 Thread Howard Cole
Terry Fielder wrote: 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 meani

Re: [GENERAL] Quick Regex Question

2007-12-20 Thread Terry Fielder
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 o

Re: [GENERAL] Quick Regex Question

2007-12-20 Thread Howard Cole
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 + mailte Howard Cole folgendes: Your expression works fine Richard, as does '(^| )ho', but can you tell me why '[ ^]ho' doesn't work?

Re: [GENERAL] Quick Regex Question

2007-12-20 Thread Howard Cole
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 + mailte Howard Cole folgendes: Your expression works fine Richard, as does '(^| )ho', but can you tell me why '[ ^]ho' doesn't work? With ^ you

Re: [GENERAL] Quick Regex Question

2007-12-20 Thread A. Kretschmer
am Thu, dem 20.12.2007, um 12:03:57 +0100 mailte Martijn van Oosterhout folgendes: > On Thu, Dec 20, 2007 at 11:51:34AM +0100, A. Kretschmer wrote: > > am Thu, dem 20.12.2007, um 10:36:08 + mailte Howard Cole folgendes: > > > Your expression works fine Richard, as does '(^| )ho', but can you

Re: [GENERAL] Quick Regex Question

2007-12-20 Thread Richard Huxton
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 + 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

Re: [GENERAL] Quick Regex Question

2007-12-20 Thread Martijn van Oosterhout
On Thu, Dec 20, 2007 at 11:51:34AM +0100, A. Kretschmer wrote: > am Thu, dem 20.12.2007, um 10:36:08 + 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 br

Re: [GENERAL] Quick Regex Question

2007-12-20 Thread A. Kretschmer
am Thu, dem 20.12.2007, um 10:36:08 + 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. Andreas -- Andreas Kretschmer Kontakt: Hey

Re: [GENERAL] Quick Regex Question

2007-12-20 Thread Howard Cole
Richard Huxton wrote: Howard Cole wrote: Hi all, I don't understand the last result: select 'Ho Ho Ho' ~* '^Ho'; returns true select 'Ho Ho Ho' ~* ' Ho'; returns true select 'Ho Ho Ho' ~* '[^ ]Ho'; returns false (Please note there is a space between ^ and ]) From my limited experience of r

Re: [GENERAL] Quick Regex Question

2007-12-20 Thread Howard Cole
Florian, Richard, Ivan. Fantastic response thank you very much. ---(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

Re: [GENERAL] Quick Regex Question

2007-12-20 Thread Ivan Sergio Borgonovo
On Thu, 20 Dec 2007 09:56:00 + Howard Cole <[EMAIL PROTECTED]> wrote: > Hi all, > > I don't understand the last result: > > select 'Ho Ho Ho' ~* '^Ho'; returns true There is actualli a Ho at the beginning of the string. > select 'Ho Ho Ho' ~* ' Ho'; returns true There are actually 2 ' Ho'

Re: [GENERAL] Quick Regex Question

2007-12-20 Thread Richard Huxton
Howard Cole wrote: Hi all, I don't understand the last result: select 'Ho Ho Ho' ~* '^Ho'; returns true select 'Ho Ho Ho' ~* ' Ho'; returns true select 'Ho Ho Ho' ~* '[^ ]Ho'; returns false (Please note there is a space between ^ and ]) From my limited experience of regex, the last one is s

Re: [GENERAL] Quick Regex Question

2007-12-20 Thread Florian Aumeier
hi select 'Ho Ho Ho' ~* '^Ho'; returns true select 'Ho Ho Ho' ~* ' Ho'; returns true select 'Ho Ho Ho' ~* '[^ ]Ho'; returns false (Please note there is a space between ^ and ]) "A /bracket expression/ is a list of characters enclosed in []. It normally matches any single character from the li

[GENERAL] Quick Regex Question

2007-12-20 Thread Howard Cole
Hi all, I don't understand the last result: select 'Ho Ho Ho' ~* '^Ho'; returns true select 'Ho Ho Ho' ~* ' Ho'; returns true select 'Ho Ho Ho' ~* '[^ ]Ho'; returns false (Please note there is a space between ^ and ]) From my limited experience of regex, the last one is searching for either