Interstate and US highway shield icons

I’m trying to convert OSM data for use in an eTrex HCx and have run into an issue with styling the special shield icons for US interstates and highways. I have used Charlie Ferrero’s cf_gps style for mkgmap as a starting point. I tried to use the regex matching to isolate motorway highways with the “I *[0-9]{1,3}” pattern for the ref tag which works fine but the resulting shield icon has the full text of the ref tag in it including the letter ‘I’. Three digit interstates end up displayed with the hbox style since the resulting four character label won’t fit in these icons. Also, when you hover over the highway with the cursor the popup text will show up as “I-Ixxx”. i.e. the eTrex is prepending it’s own prefix onto what should be just a number. Similar issues happen with the US highway prefixes.

What I would like to do is scan through an OSM data set and add a new custom tag that has just the highway number from the ref tag as its value. Then I can match those ways in the style file and have the display with the proper label in the shield icon. It doesn’t appear that mkgmap has a way to use regex submatches to build new tag values in this way. Is there another tool out there that can do this easily? I’m sure it can be done with some XSLT on the raw XML but I would like to work on pbf or o5m data if possible.