in reply to extracting numbers with a regex
Also I see no < or > in your code. So it is difficult to give any further advice...
-- perl -p -e "s/(?:\w);([st])/'\$1/mg"