--- John Carter <john.carter / tait.co.nz> wrote:
> On Fri, 13 May 2005, Logan Capaldo wrote:
> 
> > Is there a way to get a Regexp to tell you if it didn't
> match because
> > it won't match with the current input, or if it doesn't
> match (yet)
> > but potentially could with more input? Failing that, is
> there an
> > alternative regexp library for ruby that will allow that? I
> ask
> > becasue I'd like to do something along the lines of:
> 
> Add your voice to RCR179
>   http://www.rcrchive.net/rcr/show/179

I was thinking it might be nice if there was some callback when
a RE reached the end of a string (only useful with anchored
RE's).  That callback could give back more to the string or do
whatever.  I'm thinking specifically of the case "potentially
could with more input".  If you had this, you could use RE's to
match across an arbitrary number of lines in a file.  Another
option would be to have another string like class that appended
to the string when you reached the end.  But, that wouldn't
work with the current Regexp code since it is tied to String.

But, I'm also thinking that when you started wanting these
capabilities, a real parser would be a better solution than
using REs.



		
Discover Yahoo! 
Use Yahoo! to plan a weekend, have fun online and more. Check it out! 
http://discover.yahoo.com/