----- Original Message -----
From: "Rob Dixon" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 20, 2004 4:17 PM
Subject: Re: all matches of a regex-continued
> Öznur tastan wrote:
> >
> > I am still dealing with the same problem.
> > Rob has suggested me a good solution for macthing consecutive patterns
like
> > H K D but not more looser ones like for K[ED]{3,5}? L.{3}A
> > andn my poor perl knowledge doesn't help me to generalize it: /
>
> Are you just saying that the patterns that you want to split on
> can be regexes themselves instead of plain strings? I think my solution
will
> do that fine, but you need to give us an example. All the solutions
> you've been offered so far are based on your original example. You said:
I think there has been a discontuinty in replies (the mails didn't contain
everything) and I couldn't be very explanatory
(:( sorry)
you are right the patterns can ve regexes themselves. I just couldn't figure
out how to modify your code.
> Öznur tastan wrote:
> >
> > I have been trying to solve a problem which is about to drive me crazy.
> > May be some one know the answer(hopefully:)
> >
> > I want to get all macthes of a pattern in a string including the
overlaping ones.
> > For example
> > the string is "xHxxHyyKzDt"
> > and the pattern is /^(.*)H(.*)K(.*)D(.*)$/
> >
> > so in one round of match $1=x $2=xxHyy $3=z $4=t
> > in another $1=xHxx $2=yy $3=x $4=t
> >
> >
> > while ($sequence=~/$pattern/g )
> > doesn't work I think becaue the matches are overlapping
> >
> > while ($sequence=~/(?=$pattern)/g )
>
> which has been solved. Can you explain the full problem a little better?
My problem was this
I have a sets of patterns
and a string
and I know in which order these patterns are supposed to exists
What I want is to extract all the substrings when the patterns match to
the string.
>
> > In the below link I came across
> >
> > http://www.perl.com/pub/a/2002/06/04/apo5.html?page=8
> >
> > $_ = "abracadabra";
> > @all = m:any /a.*?a/;
> > produces:
> >
> > abra abraca abracada abracadabra aca acada acadabra ada adabra abra
> > Is there a version available that supports this structure?
> > Or are there any creative ideas of Perl wizards?
>
> This is a proposal for Perl 6.0. The latest development source is at 5.9
> and the latest stable release is 5.8.3.
>
> Rob
>
thanks
oznur
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>