scsh-users
[Top] [All Lists]

Re: Regular expressions

To: scsh-news@zurich.ai.mit.edu
Subject: Re: Regular expressions
From: Michel Schinz <Michel.Schinz@epfl.ch>
Date: 04 Mar 2002 15:31:24 +0100
Organization: EPFL
sperber@informatik.uni-tuebingen.de (Michael Sperber [Mr.
Preprocessor]) writes:

[...]

> If there's no upper bound on the size of the matches, you'll have a
> hard time putting a meaningful bound on the chunks of the file
> you'll have to read in order to search for regexps. (This has little
> to do with scsh.) If there is, well, just read ahead that much.

But couldn't we imagine a regular expression matcher that fetches
characters from ports as it needs? I sometimes wish I had a "lex"
macro in scsh, providing something similar to what the (f)lex tools
provides for C (and other languages). I find it sad that I have to
revert to "read-char" as soon as I need to analyze text files which
cannot be read line-by-line (e.g. any source file of a language
allowing multi-line comments).

Michel.

<Prev in Thread] Current Thread [Next in Thread>