in reply to regular expression ?!
However, one direction for further investigation might be the g regex modifier (see perlre and links therefrom).