Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re: Capture Lookahead

by GrandFather (Sage)
on Jul 26, 2005 at 01:56 UTC ( #478046=note: print w/replies, xml ) Need Help??

in reply to Capture Lookahead

I can't see what you are trying to achieve and I don't know what a "fasta sequence" is. Can you give a sample of the output that you would expect?

In the mean time, you probably mext pos ($str) rather than simply pos to manipulate the last capture pos for $str. I suspect also that you don't actually want the lookahead, it should be just a match.

Remember that a look ahead assertion is a 0 width match.

Perl is Huffman encoded by design.

Replies are listed 'Best First'.
Re^2: Capture Lookahead
by Anonymous Monk on Jul 26, 2005 at 02:11 UTC
    First, I must say I think I've seen what I want to achieve here in some other post but I don't know how to find it now - was posted several months ago.

    An example would be:

    String of: ABCDEFGHIJK

    and, on one pass, I would like to capture the substrings (of some arbitrary length)

    Further, on every pass, I want to decrease the length of the strings to be captured by 1 until the outer while loop bails out.

    Thanks for the note on my error concerning pos $str.

    Hope this makes the problem clearer.


      In that case you don't want a regex at all. Use substr.

      Perl is Huffman encoded by design.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://478046]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2017-12-12 10:42 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (329 votes). Check out past polls.