#include <iostream>
#include <regex>
using namespace std;

int main() {
	std::string s = "text here++ text\n+ text text\n+ text\ntext text";
	std::regex r("(^|\n)\\++");
	std::cout << std::regex_replace(s, r, "$1-") << std::endl;
	return 0;
}