[1269] in Coldmud discussion meeting

root meeting help first first in chain previous in chain previous next last

Re: [COLD] match_regexp bug...

daemon@ATHENA.MIT.EDU (Wed Apr 2 11:30:03 1997 )

Date: Wed, 2 Apr 1997 09:19:37 -0700 (MST)
From: Brandon Gillespie <brandon@cold.org>
To: Miroslav Silovic <silovic@srce.hr>
cc: Jeff Kesselman <jeffk@tenetwork.com>, coldstuff@cold.org
In-Reply-To: <199703312213.AAA15153@regoc.srce.hr>

On Tue, 1 Apr 1997, Miroslav Silovic wrote:
> > match_regexp appears to get confused if there are square brackets in the
> > string to be matched. My matching against the string "Class: []" throws a
> > "umatched []" error.  In all other cases the match works fine.
> > 
> > JK
> > 
> Actually it's not a bug. When ']' appears right after the '[', it's assumed
> to be part of the character list in a [] expresssion. This means that
> [] is a syntax error (correct versions are []] or \[\], depending on what
> you want to do).

Yup, this is how it behaves, becuse a backslash within a range (the square
brackets) does not escape--it is just a backslash.  I clarified all of
this in the regexp docs at: