Alex Demmler wrote:
> 
> Hi folks!

Hello,

> I have a problem with pattern matching.
> I want do find the difference between two words. I have tried, but donot get
> it work. Any tips?
> 
> Example:
> 
> 1. Word = helloRed
> 2. Word = hello
> -------------------
> Result = Red


my $word1 = 'helloRed';
my $word2 = 'hello';

# make sure that $word1 is longer than word2
( $word1, $word2 ) = ( $word2, $word1 ) if length( $word1 ) < length( $word2 );

( my $result = $word1 ) =~ s/\Q$word2//;

print "$result\n";



John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to