Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Matching bits of 2 strings

by japhy (Canon)
on Jan 22, 2002 at 04:50 UTC ( [id://140550]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    # leading common substring
    # returns length of LCS
    # requires Perl 5.6+
    ...
      ($_[0] ^ $_[1]) =~ /\0*/;
      return $+[0];
    }
    
  2. or download this
    # leading common substring
    # returns length of LCS
    # requires Perl 5.6+
    ...
      ($_[0] ^ $_[1]) =~ /(\0*)/;
      return length $1;
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-04-24 18:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found