From: Peter Booth Date: 2002-06-08T12:57:10+09:00 Subject: words[0] ! =~ /#*/ doesn't match "#aaaaaaaaa" I am attempting to parse the following file and ignore lines that begin with a # but my regexp doesn't seem to match correctly. Can anyone tell me the "right" way to match a string that begins with a # character? Peter Booth IO.foreach("C:/apps/workspace/web/build/zoneinfo.db") do |line| words = line.split("|") if words.length == 3 && words[0] != "realm" && words[0] ! =~ /#*/ realm, zone, hostlist = words[0], words[1], words[2] qatest|dmz|nbigqsa02 qatest|ndmz|nmigqsa06 #qatest|tools|nycmqsa01,nycmqsa02 #qatest|ficc|nwwpqsa01