http://www.perlmonks.org?node_id=1219107

ovedpo15 has asked for the wisdom of the Perl Monks concerning the following question:

Hey guys, I'm trying to think of a basic regex which checks if a string is a substring of another string but they are not equal.
Example:
my $str1 = "helloworld"; my $str2 = "hello"; my $str3 = "hello";

So the regex should return true for `$str2 =~ $str1` because $str2 is substring of $str1, but it should return false for `$str2 =~ $str3` because they are the same. Which regex should I use?