G
Graham Breed
Stevie_mac said:Hello again, I can do this, but I'm sure there is a much more elegant way...
A string, with a number on the end, strip off the number & discard any underscores
eg...
font12 becomes ('font',12)
arial_14 becomes ('arial',14)
Hmm, well, there's always
matcher = re.compile('\d+$|_')
return matcher.sub('', s), int(matcher.findall(s)[-1])
('arialbold1', 14)
I'm scary enough that I probably would do it this way.
Graham