Here's another answer, just in case the characters you want to keep don't fall in sequential order. If they don't, regexp with a "match" argument will split them up into separate cells. regexprep however, will just remove the unwanted parts.
ex1 = 'dogcat_1_12334'
ex2 = 'dog_1_12334_cat'
To modify this for more general cases, just change the string argument '[^a-z]'. Put any characters than you want to keep from being removed in the brackets . The carat ^ operator specifies that "everything but" what is present in the brackets is modified to the second string argument, ''. Since '' is blank, that means anything not in the [^] will be removed.