If the last instance of a dash is followed by a number, I want to change a dash to an underscore. Examples:
CER-1234 no change
CER-1234-1 CER-1234_1
CER-1234-2 CER-1234_2
CER-1234-W no change
CER-1234-W-1 CER-1234-W_1
CER-1234-W-2 CER-1234-W_2
CER-1234-WG no change
CER-1234-WG-1 CER-1234-WG_1
CER-1234-WG-2 CER-1234-WG_2
The below works except it also changes the ones I don’t want changed (the ones followed by a letter). I don’t know how to specify only if the last dash is followed by a number:
Match: (.*)(-)(.*)
Replace: \1_\3
How do I specify to only change it if the last dash is followed by a number?