scsh-users
[Top] [All Lists]

Re: Regular expressions

To: Maurício <briqueabraque@yahoo.com>
Subject: Re: Regular expressions
From: sperber@informatik.uni-tuebingen.de (Michael Sperber [Mr. Preprocessor])
Date: Mon, 04 Mar 2002 13:08:39 +0100
Cc: <scsh@zurich.ai.mit.edu>
>>>>> "Maurício" == briqueabraque  <Maur> writes:

>> Maurício>     Hi,
>> 
>> Maurício>     I've been looking for a language where I can do regular
Maurício> expressions in
>> Maurício> Windows (...) but I need to search big files (500Mb) for several
Maurício> matchs > Maurício> a regular expressions. How do you suggest me to do 
that
Maurício> in csh/scheme,
>> Maurício> (...)

>> Just read the file in line by line.  You probably want to use
>> PORT-FOLD, READ-LINE, and REGEXP-SEARCH.
>> 

Maurício>     The problem is that the regular expression usually matches many 
lines at
Maurício> once. Isn't it possible, for intance, to "memory map" the file to a 
string
Maurício> or something like that?

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.

-- 
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla

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