title: How do you match accented and tilde characters in a perl regular expression (regexp)?
body: <p>A user enters a set of names with accents and tildes:</p>
  
  <pre><code>Renato Núñez, David DeJesús, and Edwin Encarnación 
  </code></pre>
  
  <p>My database has anglicized names for these people</p>
  
  <pre><code>@names = ('Renato Nunez','David DeJesus','Edwin Encarnacion');
  </code></pre>
  
  <p>I wish to do a regexp match on these names.</p>
  
  <pre><code>$string = "Renato Núñez, David DeJesús, and Edwin Encarnación";
  foreach my $name (@names) {
      print "found:$name\n" if ($name =~ /$string/);
  }
  </code></pre>
  
  <p>As currently presented I get no matches.  </p>
  
  <p>I tried this, but it didn't work.</p>
  
  <pre><code>$string = "Renato Núñez, David DeJesús, and Edwin Encarnación";
  foreach my $name (@names) {
      $name =~ s|a|[áa]|;
      $name =~ s|e|[ée]|;
      $name =~ s|i|[íi]|;
      $name =~ s|o|[óo]|;
      $name =~ s|u|[úu]|;
      $name =~ s|n|[ñn]|;
      # Originally: print "found:$name\n" if ($name =~ /$string/);
      # Corrected to:
      print "found:$name\n" if ($string =~ /$name/);
  }
  </code></pre>
  
  <p>EDIT: sorry I had $name and $string reversed in the last line.</p>
  
  <p>Any suggestions?</p>