Re: Pattern Matching Question



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
.



Relevant Pages

  • Re: Pattern Matching Question
    ... I am not interested in literal languages. ... perl -l myscript.pl ... >> Purl Gurl wrote: ... >> I dont think we need to treat it that complex, so I would do the following instead. ...
    (perl.beginners)
  • Re: Pattern Matching Question
    ... the algorithm behind his problem is pretty easy, I dont think we need ... >> Purl Gurl wrote: ... > original parameters. ...
    (perl.beginners)
  • Re: aitch
    ... Purl Gurl wrote: ... real handicap when the child grows up. ... Alas they dont know any better having been taught this. ...
    (alt.usage.english)