I have strings with multiple dash characters, and I want the get the expression until the dash only if the dash is followwd by alphabet and not by numeric.
I have used
re.search("^([^-])+","3x130-140k-ZZ-ABC")
but it returns 3x130 which is until the first dash but I want 3x130-140k because only the second dash is followed by alphabet.
I want a regex which returns 3x130-140k from 3x130-140k-ZZ-ABC and returns 3x140k from 3x140k-ZZ-ABC .