home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: gnu.utils.bug
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!cygnus.com!bothner
- From: bothner@cygnus.com
- Subject: Re: REGEX: "re_might_match()" possible ? (NO BUG)
- Message-ID: <9211080310.AA27933@cygnus.com>
- Sender: gnulists@ai.mit.edu
- Organization: GNUs Not Usenet
- References: <199211061348.AA27125@bredex.de>
- Distribution: gnu
- Date: Sat, 7 Nov 1992 11:10:33 GMT
- Approved: bug-gnu-utils@prep.ai.mit.edu
- Lines: 28
-
- > We need a function to see if input MIGHT match.
- > Which means, we would like to check if a string matches
- > NOT AFTER typing in the whole string, BUT MEANWHILE
- > the user is typing.
-
- I hacked GNU regex to support something like that.
- Basically, there is a special error code indicating that
- the match failed because there wasn't enough input (we reach
- end fo the input string).
-
- I used this to efficiently implement a multi-level glob:
- I wanted to have
- echo PATTERN
- act as if it were:
- echo `find . -print|ggrep PATTERN`
- (where ggrep would use extended ksh-style globbing syntax for regexes).
-
- The regex extension is to avoid expanding useless directories
- (ones that could not match the pattern).
-
- The same relatively simple modification to regex could work
- for your problem. My code is part of the Q language
- (pub/Q.tar.Z on cygnus.com); I can mail my heavily-hacked
- regex separately, if you want.
-
- --Per Bothner
- Cygnus Support bothner@cygnus.com
-
-