Java + JS去除網頁HTML標籤
同樣是工作上用到,在前(Javascript)、後端(Java、JSP)同樣都有的一個需求,就是必須將讀入的字串去除HTML Tag,以下是兩個範例:
var HTML = ""; HTML+= "<p>HTML P Tag String</p>"; HTML+= "<p><a href='/test/link.html'>HTML A Tag String</a></p>"; var htmlTagPattern = /<{1}[^>]{1,}>{1}/g; //HTML Tag Pattern var htmlSplit = HTML.replace(htmlTagPattern, ""); //移除HTML Tag console.log("htmlSplit : " , htmlSplit); //輸出htmlSplit : HTML P Tag StringHTML A Tag String
package CDIT.stanley; public class trimHTML { public static void main(String[] args) { String HTML = ""; HTML+= "<p>HTML P Tag String</p>"; HTML+= "<p><a href='/test/link.html'>HTML A Tag String</a></p>"; String htmlTagPattern = "<{1}[^>]{1,}>{1}"; //HTML Tag Pattern String htmlSplit = HTML.replaceAll(htmlTagPattern, ""); //移除HTML Tag System.out.println("htmlSplit : " + htmlSplit); //輸出htmlSplit : HTML P Tag StringHTML A Tag String } }
https://nolvadex.life/# tamoxifen rash
ciprofloxacin 500 mg tablet price: buy cipro – buy cipro online
http://nolvadex.life/# aromatase inhibitor tamoxifen
where can i purchase lisinopril: lisinopril online prescription – lisinopril 1.25
Misoprostol 200 mg buy online п»їcytotec pills online cytotec online
cytotec pills buy online: buy cytotec online – buy cytotec over the counter
http://nolvadex.life/# tamoxifen benefits
https://finasteride.store/# get propecia tablets
buy cytotec pills online cheap buy cytotec over the counter buy cytotec pills online cheap
https://nolvadex.life/# natural alternatives to tamoxifen
tamoxifen rash: buy nolvadex online – cost of tamoxifen
https://finasteride.store/# generic propecia price
order cytotec online: buy cytotec pills online cheap – buy cytotec online fast delivery