Re: Binary Regular Expression Matching (bregexp)

henry@zoo.toronto.edu (Henry Spencer)
Wed, 22 Mar 1995 19:00:42 GMT

          From comp.compilers

Related articles
Binary Regular Expression Matching (bregexp) cthulhu@diku.dk (1995-03-20)
Re: Binary Regular Expression Matching (bregexp) henry@zoo.toronto.edu (1995-03-22)
| List of all articles for this month |
Newsgroups: comp.compilers
From: henry@zoo.toronto.edu (Henry Spencer)
Keywords: lex, DFA
Organization: U of Toronto Zoology
References: 95-03-109
Date: Wed, 22 Mar 1995 19:00:42 GMT

cthulhu@diku.dk (Stefan Krabbe) writes:
>Question: Do you know if there exists a regexp-function that works
> on binary files, preferably written in C, that I can
> grab? I'm looking for something almost like the library
> function regexp(3) from 4.3 BSD, or the regcomp(3C)
> from HPUX.


The POSIX.2 regex(3) package I wrote for 4.4BSD can do this, if you use
some of its kludgey extensions. (The kludgey extensions are needed to
specify the ends of the pattern and the string without making NUL a
special character; otherwise it doesn't depend on either being text.)
It's kind of slow -- I'm working on a better one -- but it does work.


>2-I'd like to be able to specify my own whitespace.
> That way I can make it a normal text-regexp if I set whitespace to newline.


Most regular-expression packages have no notion of "whitespace"; if you
want to examine your input a piece at a time, you hand it to the package
a piece at a time.
--
| Henry Spencer
| henry@zoo.toronto.edu
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.