Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re: Capture Lookahead

by SimonClinch (Deacon)
on Jul 26, 2005 at 07:51 UTC ( #478084=note: print w/replies, xml ) Need Help??

in reply to Capture Lookahead

Printing all possible substrings is what you asked for and what the replies have delivered. But I do wonder if that can be what you need, especially given that this will generate many duplicates. If you tell us more globally what the goal is, there might be a more efficient solution to the main problem we can find. For example, if you are next going to compare all these substrings with another list of strings, then it would be best to match them after all.

One world, one people

Replies are listed 'Best First'.
Re^2: Capture Lookahead
by Cristoforo (Deacon) on Jul 26, 2005 at 16:47 UTC
    I was too hasty in my assessment of the problem :-(

    Yes, there are many unanswered questions - do I want to allow overlapping palindromes?, most likely don't want to allow them when they are 'shortened' versions of a larger one. And the algorithm, (generating all possible subtrings to examine), which is very time consuming, may not be the right way to go. There may even be a module on CPAN that already does this (there is a module that does palindromes for fasta strings) and it does answer some of the questions about overlapping and others as well.

    Thanks again to everyone who responded. And to Roy Johnston for the regex solution - very nice!

    Chris Yes, fishbot does it directly. I didn't know how to use the ??{ } construct - also forgot about the @- array for the position.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://478084]
[marto]: damn
[choroba]: Munich is kind of close from here
[Corion]: marto: Maybe in three years it'll be Berlin again ;)
[marto]: in 3 years I may be able to go :P
[Corion]: choroba: Both teams will ponder on whether/where/how to organize things. The workshop will be mainly in German though
[Corion]: marto: Hehe ;)
[marto]: my out of working hours time is very scarce at the moment
[marto]: unfortunately for you guys I can still access PM during the day :P
[Corion]: marto: Ow, I hope that gets better soonish! But I feel some $work-timecrunch looming at my $work as well
[Corion]: marto: Ah, so you can multiplex work and PM time ;-D

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2017-06-29 08:19 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (655 votes). Check out past polls.