我想匹配一個html代碼,直到下一次出現...或結束。匹配所有內容,直到下一個匹配
目前,我有以下的正則表達式:
(<font color=\"#777777\">\.\.\. .+?<\/font>)
將匹配這一點:
1. <font color="#777777">... </font><font color="#000000">lives up to the customer's expectations. The subscriber is </font>
2. <font color="#777777">... You may not want them to be </font>
3. <font color="#777777">... </font><font color="#000000">the web link, and </font>
但我想:
1. <font color="#777777">... </font><font color="#000000">lives up to the customer's expectations. The subscriber is </font><font color="#777777">obviously thinking about your merchandise </font><font color="#000000">in case they have clicked about the link in your email.</font>
2. <font color="#777777">... You may not want them to be </font><font color="#000000">disappointed by simply clicking </font>
3. <font color="#777777">... </font><font color="#000000">the web link, and </font><font color="#777777">finding </font><font color="#000000">the page to </font><font color="#777777">get other than </font><font color="#000000">what they thought it </font><font color="#777777">will be.. If America makes</font>
這裏是我想要的HTML解析:
<font color="#777777">... </font><font color="#000000">lives up to the customer's expectations. The subscriber is </font><font color="#777777">obviously thinking about your merchandise </font><font color="#000000">in case they have clicked about the link in your email.</font><font color="#777777">... You may not want them to be </font><font color="#000000">disappointed by simply clicking </font><font color="#777777">... </font><font color="#000000">the web link, and </font><font color="#777777">finding </font><font color="#000000">the page to </font><font color="#777777">get other than </font><font color="#000000">what they thought it </font><font color="#777777">will be.. If America makes</font>
與示範: http://rubular.com/r/mmQ4TBZb96
如何匹配所有文字開始......得到高於期望的比賽嗎?
感謝您的幫助!
問題描述得很差。當你說所有的字符串時,你的意思是__font__標籤內的字符串嗎?你期望什麼樣的輸出 – tr33hous
你的預期匹配輸出是什麼? – anubhava
你想加入短語嗎? – mzmm56