"Last occurrence in a line" is a bit ambiguous. The way I see it can mean either:
"Foo: 123, yada: GE1/0/1, Bar: null"
The meaning of the last occurrence in the "word" GE1 / 0/1 or:
"GE1/0/1"
Like a complete line.
In the latter case, this is a fairly simple question, you only need to decide how specific you can be in your regular expression.
$str =~ s{/(\d+)$}{:$1};
It is perfectly normal if the last character (s) can only be numbers.
In the first case, which I do not think you mean, but I will include it anyway, you need to be more specific:
$str =~ s{(\byada:\s+\w+/\w+)/(\w+\b)}{$1:$2};
source share