Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Matching bits of 2 strings

by japhy (Canon)
on Jan 22, 2002 at 04:50 UTC ( #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
Node Status?
node history
Node Type: note [id://140550]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (12)
As of 2014-07-29 11:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (216 votes), past polls