🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by nico Fri, 06 Nov 1992 15:48
REGEX: "re_might_match()" possible ? (NO BUG)
#1040
Author: nico
Date: Fri, 06 Nov 1992 15:48
27 lines
1347 bytes
Hi folks,
I know, this is not the right place to ask, but may be
one of you have a quick solution.

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.

For example if the pattern is "[0-9][0-9].*B", we
would like to return YES if the user just typed in
"34tf", but NO if he typed in "a34".

I know, this is not the right place to ask, but maybe
one of you have a quick solution.
Anyway where is the right place for such questions ?

aTdHvAaNnKcSe

--------
Nico
                                 address: BREDEX GmbH
email:   nico@bredex.de                   Nicolai Josuttis
                                          Kastanienallee 2a 
phone:   +49 531 75480                    D-3300 Braunschweig
fax:     +49 531 796358                   Germany
--------
Re: REGEX: "re_might_match()" possible ? (NO BUG)
#1053
Author: bothner
Date: Sat, 07 Nov 1992 11:10
27 lines
1442 bytes
> 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
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