Never mind, I did not read the original post very carefully.
is the pattern with the dash consistent? for example you could use subfield
Text(If(isnum(subfield(foo,'-',1)),Num(subfield(foo,'-',1)),subfield(foo,'-',1))) & If(Len(subfield(foo,'-',2)>0,'-' & Text(If(isnum(subfield(foo,'-',2)),Num(subfield(foo,'-',2)),subfield(foo,'-',2)))
Of course if pattern with the dashes is not consistent or if you have values with more than one dash then you need to figure out what the most number of dashes is and write a dynamic expression based on that.
ugh that sounds terrible.
If your 18 digit alphanumeric material actually might show only up to 14 significant numeric digits...
Slightly changing Chris initial approach:
Text(If(Isnum(evaluate(Test)),Num(evaluate(Test)),Test)) as Test2
Test Test2 05241X-001 05241X-001 05491X-001 05491X-001 00000000000100345 100345 00000000000100692 100692