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 } }
buy ciprofloxacin over the counter: antibiotics cipro – cipro for sale
https://lisinopril.network/# 1 lisinopril
http://lisinopril.network/# no prescription lisinopril
cytotec pills buy online Cytotec 200mcg price cytotec abortion pill
https://ciprofloxacin.tech/# buy cipro online canada
http://finasteride.store/# buy cheap propecia online
buying generic propecia price: propecia cost – propecia prices
cost generic propecia prices cheap propecia no prescription cost propecia prices
http://finasteride.store/# cost of generic propecia without prescription
benefits of tamoxifen: tamoxifen and uterine thickening – tamoxifen vs raloxifene
order cheap propecia pills cost generic propecia cost of cheap propecia price
buy cytotec online fast delivery: order cytotec online – buy cytotec pills online cheap
http://ciprofloxacin.tech/# purchase cipro
https://finasteride.store/# buy cheap propecia for sale
http://cytotec.club/# buy cytotec pills
http://lisinopril.network/# lisinopril 5 mg prices
lisinopril from canada lisinopril 20 lisinopril 60 mg
https://nolvadex.life/# where to buy nolvadex
buy generic ciprofloxacin: cipro generic – ciprofloxacin 500 mg tablet price
http://finasteride.store/# cost of cheap propecia online
ciprofloxacin over the counter buy generic ciprofloxacin buy cipro online without prescription
cytotec online: purchase cytotec – order cytotec online
effexor and tamoxifen: nolvadex pct – tamoxifen blood clots
https://finasteride.store/# cost propecia without dr prescription
https://cytotec.club/# purchase cytotec
buy ciprofloxacin buy cipro online without prescription п»їcipro generic
https://ciprofloxacin.tech/# purchase cipro
propecia sale: propecia for sale – order cheap propecia without dr prescription
common side effects of tamoxifen: lexapro and tamoxifen – tamoxifen side effects forum
cytotec online cytotec abortion pill buy cytotec pills