Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^3: RegEx + vs. {1,}

by tobyink (Abbot)
on Oct 10, 2012 at 22:08 UTC ( #998328=note: print w/replies, xml ) Need Help??


in reply to Re^2: RegEx + vs. {1,}
in thread RegEx + vs. {1,}

Indeed. There can never be a three character sequence in your string which occurs more frequently than a two character sequence. (Because the three character sequence contains two two character sequences.)

perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

Replies are listed 'Best First'.
Re^4: RegEx + vs. {1,}
by grizzley (Chaplain) on Oct 11, 2012 at 07:32 UTC
    But what should be returned if we have string 'abcabcabcdef' with same amount of three-chars-long and two-chars-long string? 'ab' or 'abc'? I assume OP wants the longer one.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://998328]
help
Chatterbox?
[Discipulus]: ridiculous! i'm leading the montly best section. oh tempora oh mores..
[Corion]: :-D
[Eily]: congrats Discipulus :)
[Eily]: (somehow I just typed "cong" and chrome proposed to complete the message :D )

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (10)
As of 2017-04-26 11:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (473 votes). Check out past polls.