Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Again Fuzzy regex !!!!

by AnomalousMonk (Archbishop)
on May 22, 2015 at 22:48 UTC ( [id://1127507]=note: print w/replies, xml ) Need Help??


in reply to Again Fuzzy regex !!!!

I don't have the time right now to go over almost nine hundred lines of C code to extract its functionality, but here's a version of your OPed Perl code that may perhaps serve as a starting point for what you want:

c:\@Work\Perl\monks>perl -wMstrict -le "my $long = 'xxxxxxAAAAAxxxxxx'; my $short = 'AAxAA'; ;; my $len = length $short; for my $offset (0 .. length($long) - $len) { my $m = ($short ^ substr $long, $offset, $len) =~ tr{\0}{\0}; print qq{matched $m at offset $offset}; } " matched 1 at offset 0 matched 1 at offset 1 matched 2 at offset 2 matched 3 at offset 3 matched 2 at offset 4 matched 3 at offset 5 matched 4 at offset 6 matched 3 at offset 7 matched 2 at offset 8 matched 3 at offset 9 matched 2 at offset 10 matched 1 at offset 11 matched 1 at offset 12

Update: Pay close attention to the advice of BrowserUk; big-data processing is his bread and butter.


Give a man a fish:  <%-(-(-(-<

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1127507]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2024-04-24 06:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found