我使用一个简单的正则表达式将换行符替换为换行符:
br_regex = /<br>/; input_content = input_content.replace(br_regex, "\n");
这只替换了break标记的第一个实例,但我需要替换所有实例。preg_match_all()可以在PHP中做到这一点,但是我想知道JavaScript的等价物是什么。
preg_match_all()
https://stackoverflow.com/questions/407256
相似问题