First, discrete data should be stored distinctly. You shouldn't jam pieces of data that each have meaning into one field. Your data should be in 2 fields so you don't have to programatically seperate it.
Or if it is ALWAYS delimited by "-" then look into the SPLIT function. But if the delimiter is NOT always "-" (e.g. NO delimiter, as shown in your second example), then you have a much worse problem on your hands. You would have to parse this backwards to find the first non-digit character when testing from right to left.
I presume 'x' represents any alpha and structure is not consistent and likely will require a VBA custom function. Fairly common topic. Have you searched?