🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.editors
Article #3195

Re: pattern matches

#3195
From: liberte
Date: Sat, 02 Jul 1988 16:20
23 lines
1295 bytes
I would like to have a more powerful negation operator.
Currently, regexps allow negation of a signal set of chars.
I would like negation of a whole subexpression.

e.g. abc(def)^ would match a string that starts with
abc but is NOT followed by def.

I think "^" would be unambiguous as a postfix operator.
"^" as beginning-of-line would only be
valid as the first char of a subexpression.
There is possible confusion with [^abc] as negation of a char set,
but such use could be phased out since [abc]^ is equivalent.

Since negation of a regular expression is a regular expression
and all you have to do to a finite state machine is flip
accepting and non-accepting states, this should be trivial.
Why wasnt it done before?

Dan LaLiberte
uiucdcs!liberte
liberte@cs.uiuc.edu
liberte%a.cs.uiuc.edu@uiucvmd.bitnet
Technical Details
Message-ID: <37200009@m.cs.uiuc.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!att!pacbell!ames!ncar!gatech!purdue!i.cc.purdue.edu!j.cc.purdue.edu!pur-ee!a.cs.uiuc.edu!m.cs.uiuc.edu!liberte
References: <427@grand.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!att!pacbell!ames!ncar!gatech!purdue!i.cc.purdue.edu!j.cc.purdue.edu!pur-ee!a.cs.uiuc.edu!m.cs.uiuc.edu!liberte
From: liberte@m.cs.uiuc.edu
Newsgroups: comp.editors
Subject: Re: pattern matches
Message-ID: <37200009@m.cs.uiuc.edu>
Date: 2 Jul 88 16:20:00 GMT
References: <427@grand.UUCP>
Lines: 23
Nf-ID: #R:grand.UUCP:427:m.cs.uiuc.edu:37200009:000:813
Nf-From: m.cs.uiuc.edu!liberte    Jul  2 11:20:00 1988