Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: Capture Lookahead

by Anonymous Monk
on Jul 26, 2005 at 02:11 UTC ( #478050=note: print w/replies, xml ) Need Help??


in reply to Re: Capture Lookahead
in thread Capture Lookahead

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)

ABCDEF
BCDEFG
CDEFGH
DEFGHI
EFGHIJ
FGHIJK
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.

Chris

Replies are listed 'Best First'.
Re^3: Capture Lookahead
by GrandFather (Sage) on Jul 26, 2005 at 02:25 UTC

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


    Perl is Huffman encoded by design.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://478050]
help
Chatterbox?
[marto]: hey Corion, how's tricks?
[Corion]: marto: Currently all well - work is even OK currently ;) I should start translating my WWW::Mechanize:: Chrome talk to English and recheck that my demos all work, but I have two weeks for that still :)
[Corion]: So, most things are looking good :-D
[Corion]: I should write some more code for my Jekyll clone, but I don't feel like it, so maybe I should just let that linger instead ;)
[karlgoethebier]: "...mein enemy..."

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (8)
As of 2017-07-26 10:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (390 votes). Check out past polls.