in reply to Re^2: Check if a word is included in another
in thread Check if a word is included in another

Isn't this the same as the original algorithm in the first post?
  • Comment on Re^3: Check if a word is included in another

Replies are listed 'Best First'.
Re^4: Check if a word is included in another
by PeterPeiGuo (Hermit) on Apr 18, 2010 at 23:07 UTC

    Not the same, with or without /g makes a big difference in this case.

    use warnings; use strict; my $str1 = "112345"; $str1 =~ s/1//g; print $str1, "\n"; my $str2 = "112345"; $str2 =~ s/1//; print $str2, "\n";

    Peter (Guo) Pei

      I mean the original original post, where the question was first asked by me. There are no s///g in that post.