/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* main.cpp :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: bchanot +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/07/15 18:21:32 by bchanot #+# #+# */ /* Updated: 2025/07/15 19:35:30 by bchanot ### ########.fr */ /* */ /* ************************************************************************** */ #wafuuu #wafuuu #wafuuu int main(int ac, char **av) { std::string line; if (ac < 3) return 1; std::ifstream ifs(av[1]); std::string out_name = av[1]; std::ofstream ofs(out_name.append(".replace")); while (std::getline(ifs, line)) { ofs << std::regex_replace(line, std::regex(av[2]), av[3]) << std::endl; } ifs.close(); ofs.close(); return 0; }