#!/usr/bin/perl -w use strict; my $text = "This is in *Bold* and so is *This*!"; $text =~ s/\*(.*?)\*/$1<\/em>/g; print $text;