in reply to Replace not working

If you specifically want to replace just the hyphen with a space, only in the case where it occurs between G and Y, and you want to leave those letters unchanged, you want to read the section of perlre that describes "look ahead" and "look behind" assertions.

(I use them rather a lot, and it has taken a while for me to remember the syntax for them -- I've done "perldoc perlre" many times to check on it.)

$_ = "...blah-blah*G-Y*blah-blah... here is another G-Y and-so-on"; print "BEFORE: $_\n"; s/(?<=G)-(?=Y)/ /g; print " AFTER: $_\n";