From: Andrew Johnson Date: 2006-03-29T03:38:55+09:00 Subject: Re: Regexp to match strings that _don't_ being with a string On Wed, 29 Mar 2006 03:24:36 +0900, Wes Gamble wrote: > I tried /^[^(xyz)]/ but I don't trust it. I don't think the grouping > will take inside the character class. The [^(xyz)] creates a negative character class, so your regex would match any string that started with a character not in the given set. Not what you really want > Do I need a negative lookahead assertion? That would be a simple solution: /^(?!xyz)/ which will match when the beginning of the line/string is not followed by 'xyz'. andrew -- Andrew L. Johnson http://www.siaris.net/ What have you done to the cat? It looks half-dead. -- Schroedinger's wife