Not trying to be insulting, but, you do know that perl supports several character classes that match what you are using. Such as \d = [0-9] as well as inverted patterns, \D = [^0-9], etc.
Then again, assuming that you are familiar with perlre, you might be glad to know that you can add your own or CPAN's modules to where ever you can write files. It does not have to be a global install for it to work. I am assuming that you could spare a few Kb's worth of diskspace as you said server, not embedded system
Confucius says kill mosquito unless cannon