my @numbers4 = $text =~ /\b \d{4} \b/gx; foreach $unit4 (@numbers4) { $text =~ s/$unit4/\\$unit4\<\/b\>\<\/a\>/i; } #### 2003