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 cytotec over the counter buy cytotec online fast delivery buy cytotec over the counter
https://misoprostol.top/# buy cytotec over the counter
buy cipro online without prescription: ciprofloxacin 500 mg tablet price – ciprofloxacin 500mg buy online
how to buy doxycycline online: where to get doxycycline – buy generic doxycycline
ciprofloxacin order online cipro cipro 500mg best prices
https://misoprostol.top/# buy cytotec over the counter
canadian neighbor pharmacy CIPA approved pharmacies canadian pharmacy king
http://indianpharmgrx.com/# cheapest online pharmacy india
п»їlegitimate online pharmacies india: indian pharmacy delivery – Online medicine home delivery
thecanadianpharmacy My Canadian pharmacy medication canadian pharmacy
top online pharmacy india indian pharmacy delivery best online pharmacy india
http://canadianpharmgrx.com/# canadian pharmacy world
canadian drugstore online Certified Canadian pharmacies canada pharmacy online
top online pharmacy india: Generic Medicine India to USA – indian pharmacies safe
top 10 online pharmacy in india indian pharmacy delivery world pharmacy india
reputable indian pharmacies: п»їlegitimate online pharmacies india – online pharmacy india
mexico drug stores pharmacies online pharmacy in Mexico mexican drugstore online
indian pharmacy online: Healthcare and medicines from India – best online pharmacy india
best india pharmacy: Online medicine home delivery – pharmacy website india
http://canadianpharmgrx.xyz/# canada pharmacy reviews
best online pharmacy india: indian pharmacy delivery – indian pharmacies safe
online pharmacy india: Generic Medicine India to USA – india pharmacy
canadian pharmacy Canada pharmacy canadapharmacyonline legit
mexican pharmacy Mexico drugstore best online pharmacies in mexico
reputable canadian pharmacy: CIPA approved pharmacies – canadianpharmacyworld
http://mexicanpharmgrx.shop/# medication from mexico pharmacy
cheapest online pharmacy india indian pharmacy delivery indianpharmacy com
http://indianpharmgrx.shop/# top online pharmacy india
my canadian pharmacy reviews CIPA approved pharmacies real canadian pharmacy
Online medicine order: indian pharmacy – india pharmacy mail order