jakarta-regexp-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ian Swett <isw...@ispheres.com>
Subject Re: Retrieving indices of repeated closures
Date Tue, 27 Mar 2001 20:10:20 GMT
I had started to do this as you recc.(with Vector), but I'm curious as to
why you say not to initialize until I have 2 + elements?  For efficiency?
I agree it'll save a little bit of time, but I can't imagine it would be a
huge slowdown.  But I very well may be wrong, and I'll try to do it in the
most efficient manner anyway.

Ian

On Wed, 28 Mar 2001, Michael McCallum wrote:

> The simple solution is to have a vector for each paren. At the moment only the last paren
is 
> saved as the matches are put into an array.
> 
> Just dont initialise the vector until you have 2 + elements.
> 
> The workaround is to use a reluctant match and then call it repeatedly using the match(
string, 
> index ) method which is supposed to be internal but i dont think it is.
> 
> Michael
> 
> On 27 Mar 2001, at 11:01, Ian Swett wrote:
> 
> > I would like to be able to gather all the indices of matches inside
> > repeated closures, instead of just retrieving one of them.
> > 
> > A simple example:
> > matching regexp (abc)* against zyabcabcabc  will only allow the start/end
> > locations of one of the three abc sequences to be retrieved.  I would like
> > to retrieve all of them.  Obviously this is an excessively simple example,
> > but it conveys the idea.
> > 
> > Is there a relatively simple way to do this already?  Or a workaround I
> > could use that wouldn't be very ugly or slow?
> > 
> > Is there enough demand to add this capability?  It seems like it should be
> > relatively easy to do.  I could start working on it if others want it.
> > 
> > Ian
> > 
> > 
> 
> 
> 


Mime
View raw message