Programming in python: Regular expression split on newest questions tagged python – Stack Overflow

I have inputs similar to the following:

TV-12VX
TV-14JW
TV-2JIS
VC-224X

I need to remove everything after the numbers after the dash. The result would be:

TV-12
TV-14
TV-2
TV-224

How would I do this split via regular expressions?

See Answers


source: http://stackoverflow.com/questions/11821264/regular-expression-split
Programming in python: programming-in-python



online applications demo