[939] in Coldmud discussion meeting

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

[COLD] regular expressions

daemon@ATHENA.MIT.EDU (Fri Mar 22 15:38:07 1996 )

Date: Fri, 22 Mar 1996 12:58:31 -0700 (MST)
From: Brandon Gillespie <brandon@tombstone.sunrem.com>
To: coldstuff@cold.org

Since there is a POSIX standard for regular expressions, should we hook into
the system regular expressions if they exist, resorting to our own regexp 
code if it does not?

The problems which could arise with this is that the current POSIX 
standard seems to be somewhat vague, leaving openings for interpretation 
by implementors.  Basically, certain aspects of regular expressions could 
change depending on what OS the driver is running under.

From the FreeBSD man pages on POSIX regular expressions (to explain how 
the vagueness is handled in one OS):

BUGS
       Having two kinds of REs is a botch.

       The current 1003.2 spec says that `)' is an ordinary char-
       acter in the absence of an  unmatched  `(';  this  was  an
       unintentional  result  of  a  wording error, and change is
       likely.  Avoid relying on it.

       Back references are a dreadful botch, posing  major  prob-
       lems  for  efficient implementations.  They are also some-
       what  vaguely  defined   (does   `a\(\(b\)*\2\)*d'   match
       `abbbd'?).  Avoid using them.

       1003.2's  specification  of  case-independent  matching is
       vague.  The ``one  case  implies  all  cases''  definition
       given  above is current consensus among implementors as to
       the right interpretation.

       The syntax for word boundaries is incredibly ugly.

-Brandon