sub weirdmatch { my ($foo, $bar) = @_; $bar =~ s/\Q$1// or return 0 while $foo =~ s/(.)//; return 1; } print weirdmatch('the' => 'there'); # 1 print weirdmatch('foo' => 'raboof'); # 1 print weirdmatch('moo' => 'monkey'); # 0
In reply to Re: Does a regex exist for this problem?
by Juerd
in thread Regex to find intersection of two words
by 2501
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |