Re: [問題] 關於regular expression

看板Perl作者 (梭哈!)時間18年前 (2007/08/18 01:26), 編輯推噓1(101)
留言2則, 1人參與, 最新討論串2/6 (看更多)
再請問一下 假如我的句子中不只一個標籤,如下: <font color = "red"><B>E2F-1</B></font> can also <font color = "blue"><B>induce</B></font> <font color = "green"><B>p73</B></font> via a p53-independent apoptotic pathway. 希望能去除所有的標籤,而留下: can also via a p53-independent apoptotic pathway. 這樣的話,正規表示法應該如何表示才對? 感謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 61.228.78.92

08/19 10:43, , 1F
1 while (s{<(\w+).*?>.*?</\1>}{}g); you may need /s
08/19 10:43, 1F

08/19 11:04, , 2F
then tr/ //s;
08/19 11:04, 2F
文章代碼(AID): #16nTfFHk (Perl)
文章代碼(AID): #16nTfFHk (Perl)