Thread Ersetzung eines Links mit Perl (23 answers)
Opened by lids at 2008-04-25 13:49

anti
 2008-04-25 17:55
#108884 #108884
User since
2003-11-29
155 Artikel
BenutzerIn
[default_avatar]
Ich probiers mal:

Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
my $zusatz="http://www.testit.de/test.pdf _blablub_";

my $format = $zusatz =~ m/\.pdf/ ? 'pdf' : 'html';
$zusatz =~ m!(http://.*?)\s_(.*?)_!g;

print '
<table>
  <tr>
    <td width="33"><img src="graphics/'.$format.'_icon.gif"></td>
    <td class="text">'.$2.'
      <a href="'.$1.'" target="_blank">Datei im '.$format.'-Format</a>
    </td>
  </tr>
</table>
';


greetz,
anti

View full thread Ersetzung eines Links mit Perl