#include <regex>

#include "stringUtils.h"

const std::regex doubleOrMoreSpaceExp(
	"\\s\\s+",
	std::regex_constants::ECMAScript | std::regex_constants::icase
);

const std::regex tabExp(
	"\\t+",
	std::regex_constants::ECMAScript | std::regex_constants::icase
);

const std::regex newLineExp(
	"\\n+",
	std::regex_constants::ECMAScript | std::regex_constants::icase
);

std::string cleanContent(std::string answer) {
	answer = std::regex_replace(answer, newLineExp, "");
	answer = std::regex_replace(answer, tabExp, " ");
	answer = std::regex_replace(answer, doubleOrMoreSpaceExp, " ");
	return answer;
}
