From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <88f2fccf6f0ecb1a3924f8d37b52abf8@bellsouth.net> References: <88f2fccf6f0ecb1a3924f8d37b52abf8@bellsouth.net> Date: Tue, 13 Jul 2010 17:46:41 +0200 Message-ID: From: hugo rivera To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Subject: Re: [9fans] regexp doubt Topicbox-Message-UUID: 3eaf8cec-ead6-11e9-9d60-3106f5b1d025 maybe I'm using a buggy version of acme, because /stat[abc]?[- ;]/ also fails with a "malformed" error. And according to the regexp(7) man page, you should be able to precede a '-' with a backslash. 2010/7/13 : >> both of them yield a >> >> regexp: malformed `[]' >> >> error. >> I forgot to mention and I had an alternative solution from the >> beginning /stat[abc]?([ ;]|-)/ >> I'm just wondering the reason the original version failed. > > As I recall, if you're going to include a hyphen in a character > class, it has to be the first character so that it isn't taken to > indicate a range. > > BLS > > > -- Hugo