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 } }
cipro 500mg best prices: ciprofloxacin 500 mg tablet price – ciprofloxacin
http://finasteride.store/# cost of cheap propecia pill
https://ciprofloxacin.tech/# where can i buy cipro online
buy cytotec pills Misoprostol 200 mg buy online purchase cytotec
http://ciprofloxacin.tech/# ciprofloxacin
http://nolvadex.life/# raloxifene vs tamoxifen
order cheap propecia without dr prescription: buy generic propecia without insurance – cost of propecia without a prescription
how cЙ‘n i get cheap propecia pills buy generic propecia no prescription generic propecia without prescription
cost propecia without insurance: buying cheap propecia without prescription – cost of cheap propecia without insurance
nolvadex estrogen blocker: common side effects of tamoxifen – tamoxifen and weight loss
http://ciprofloxacin.tech/# ciprofloxacin generic
propecia without a prescription propecia without dr prescription get generic propecia
https://finasteride.store/# order cheap propecia
http://ciprofloxacin.tech/# ciprofloxacin
https://ciprofloxacin.tech/# where can i buy cipro online
https://cytotec.club/# buy cytotec online
purchase cytotec: cytotec buy online usa – order cytotec online
buy cytotec over the counter Abortion pills online order cytotec online
http://nolvadex.life/# does tamoxifen cause weight loss
purchase cytotec: Misoprostol 200 mg buy online – Cytotec 200mcg price
lisinopril 12.5 best price for lisinopril 20 mg lisinopril 10 mg on line prescription
buy cytotec: cytotec online – buy cytotec online fast delivery
http://ciprofloxacin.tech/# ciprofloxacin order online
http://ciprofloxacin.tech/# ciprofloxacin generic price
cost of generic propecia tablets cost propecia without a prescription buy propecia without rx
http://cytotec.club/# Cytotec 200mcg price
http://finasteride.store/# cost of propecia price
ciprofloxacin: buy ciprofloxacin – purchase cipro
pct nolvadex nolvadex gynecomastia tamoxifen buy
Cytotec 200mcg price: buy cytotec – buy cytotec online fast delivery