Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2017-05-28 03:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?