From: Glenn Jackman Date: 2009-07-15T03:50:06+09:00 Subject: Re: a regex that does not contain comma At 2009-07-14 09:08AM, "Axel Schmalowsky" wrote: > David A. Black wrote: > > string = <<-EOM > > Hi. > > I have, at a minimum, two commas. > > Bye. > > EOM > > > > p "Match!" if /^[^,]*$/.match(string) > > => Match! > > > Technically, the regexp above always succeeds (iirc). Always? Only if a newline appears before the first comma. > Even though the regexp is delimited by ^ and $, > it matches always as along as the string against which the regexp is applied > does not consist of only a single comma ('[^,]* -- match everything > (including nothingness) but a comma). -- Glenn Jackman Write a wise saying and your name will live forever. -- Anonymous