in reply to extracting numbers with a regex
Please see Regexp::Common/Regexp::Common.
This will help you from reinventing the wheel,
and allow you to capture a wider array of numbers.
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"
In Section
Seekers of Perl Wisdom