#!perl # slurp the entire file local $/ = undef; open INFILE, $ARGV[0] or die "Could not open file. $!"; $string = ; close INFILE; while ($string =~ s/\*\*(.*)\*\* \[\[\d+\]\]\((.*)\)/$1<\/a>/) {} print "$string";