Regex 删除文本区域的htmlText中的空行

Regex 删除文本区域的htmlText中的空行,regex,actionscript-3,apache-flex,Regex,Actionscript 3,Apache Flex,我有htmltext作为 <p>Here is what some pupils told me about how they prepared for and fared in yesterday's preliminary round.</p> <hr /> <p>"I will stay calm and try my best. If I do not know a word, I will just have to put someth

我有htmltext作为

<p>Here is what some pupils told me about how they prepared for and fared in yesterday's preliminary round.</p>
<hr />

<p>"I will stay calm and try my best. If I do not know a word, I will just have to put something down."</p>
<p><strong>some text</strong></p>
<hr />


<p>"I am more confident than last year because I have experience. I read the newspaper and I looked through the dictionary for difficult words and tagged them."</p>
<p><strong>some text</strong></p>
<hr />
以下是一些学生告诉我的关于他们在昨天预赛中的准备和表现


“我会保持冷静,尽我最大的努力。如果我一个字也不知道,我就得写点东西。”

一些文本


“我比去年更有信心,因为我有经验。我看报纸,查字典,查找难词,并给它们加上标签。”

一些文本


我显示的内容与textarea.htmlText相同


但是文本区域显示上面的内容,中间有太多的空行。有没有办法删除文本中的换行符?文本来自服务器端

在CSS中设置p标记的样式。
例如:


如何尝试用空字符串替换换行符,如:
htmlText=htmlText.replace(/\r?\n/g,”)这将删除每一个换行符,我需要至少一个换行符,但如果有更多的换行符,则需要删除它们。好的,然后将上面的正则表达式更改为this
/\r?\n{2,}/g
。这将只删除两个或多个出现的模式。
   p{
        line-height:0.5;
    }