in reply to Matching or masking specific characters in an array of strings

I think I understand what you're looking for. Here is an example which I think will help you
my $x1 = "hello" ; my $x2 = "balln" ; $x1 =~ s/[^$x2]/-/g ; print $x1 ;
Produces: --ll-

If not, ignore this post :)

Cheers LuCa

UPDATE: I think I have to admit that my approach doesn't work at all, sorry
  • Comment on Re: Matching or masking specific characters in an array of strings
  • Download Code

Replies are listed 'Best First'.
Re^2: Matching or masking specific characters in an array of strings
by duggles (Acolyte) on Dec 19, 2008 at 14:38 UTC

    thanks! you're right it doesn't quite cover the complete problem, but it furthers my regex education!

    Life is short, but it's wide -- Chuck Pyle