I need a regular expression to use in python that captures one group containing the whole string minus the last 2 characters, but if the string have a "-" , then ignore it and all after it.
Ex:
abcde = abc
jklmno-pqrs = jklm
I think it would be a mix between (.*)..$
and ^([^-]*)
, but I dont know how to combine them.