#!/usr/bin/perl -lw use strict; $_ = "thought test tot 1 2 3 tesset"; s/t(?!est\b)\w*t\s*//g; print;