s{(-(.+?)-)}{$hash{$2} // $1}eg; [download]
In reply to Re: Substitution problem by JavaFan in thread Substitution problem by selva