$_ = "host-abc:/var/log/messages::::read_intr"; if (/host-abc.*messages/) { $_ = "new string"; }