🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by La Monte Yarroll Thu, 28 Jan 1993 08:36
Seeking partial match for regexp.
#2240
Author: La Monte Yarroll
Date: Thu, 28 Jan 1993 08:36
30 lines
1909 bytes
I'm writing a filter for an emacs process which looks for commands in
the output stream.  The commands are removed and executed.  Anything
that is not a command just gets inserted into the buffer.

I'm using an accumulator-style filter where the filter just appends
the new output to an accumulator, and calls a function to process the
current accumulator.

I'd like to use a regexp like "cmd1\\|cmd2\\cmd3" to recognize
commands in the accumulator.  I'd like to be able to find the first
full or _partial_ match in the accumulator.  By partial match I mean a
match that fails only because we got to the end of the accumulator.
If the match was only partial, just insert the junk before the partial
match, and then wait for the next invocation of the filter.

I think I could do this with the GNU regexp package, but I don't seem
to have as much flexibility with the elisp regexp stuff.

Can somebody tell me how to check for a _partial_ match to a regexp?

Or can you suggest a better approach?

For the moment, I'll just pretend that a command will never be split
across two different filter invocations, but I don't like this much.

--
La Monte H. Yarroll	Home:		piggy@baqaqi.chi.il.us
   Work:		piggy@hilbert.maths.utas.edu.au
   AKA:			piggy@gargoyle.uchicago.edu
   Once upon a time:	postmaster@clout.chi.il.us
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads