Re: Pattern Matching Question
- From: "Purl Gurl" <purlgurl@xxxxxxxxxxxx>
- Date: Mon, 28 Nov 2005 18:41:39 GMT
xicheng wrote:
> Purl Gurl wrote:
> > xicheng wrote:
> > > Purl Gurl wrote:
> > > > daxm wrote:
> > > your result is not correct if $HugeString is like this:
> > > $HugeString = "AAAAAAAAAASDFGHJKLAAAAAAAAAAAAcdfn";
> the algorithm behind his problem is pretty easy,
Is it now?
> I dont think we need to treat it that complex, so I would do the following instead.
You do not know what I think. Your "we" is illogical.
All are capable of playing the "what if" game, yes?
#!perl
$HugeString = "AAAAAAAAAASDFGHJJKLAAAAAAAAAAAAcdfn";
$Head = "";
for $h(0..(length($HugeString)-16)) {
$_=substr($HugeString,$h,16);
print if /^$Head/;
}
AAAAAAAAAASDFGHJAAAAAAAAASDFGHJJAAAAAAAASDFGHJJKAAAAAAASDFGHJJKLAAAAAASDFGHJJKLA
AAAAASDFGHJJKLAAAAAASDFGHJJKLAAAAAASDFGHJJKLAAAAAASDFGHJJKLAAAAAASDFGHJJKLAAAAAA
SDFGHJJKLAAAAAAADFGHJJKLAAAAAAAAFGHJJKLAAAAAAAAAGHJJKLAAAAAAAAAAHJJKLAAAAAAAAAAA
JJKLAAAAAAAAAAAAJKLAAAAAAAAAAAAcKLAAAAAAAAAAAAcdLAAAAAAAAAAAAcdfAAAAAAAAAAAAcdfn
Purl Gurl
.
- Follow-Ups:
- Re: Pattern Matching Question
- From: xicheng
- Re: Pattern Matching Question
- References:
- Re: Pattern Matching Question
- From: Purl Gurl
- Re: Pattern Matching Question
- From: xicheng
- Re: Pattern Matching Question
- Prev by Date: Re: Installing Perl Modules Locally
- Next by Date: Re: Pattern Matching Question
- Previous by thread: Re: Pattern Matching Question
- Next by thread: Re: Pattern Matching Question
- Index(es):
Relevant Pages
|
|