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 } }
reputable canadian pharmacy fda approved canadian online pharmacies canadian world pharmacy
india pharmacy without prescription: cheapest online pharmacy india – online medicine shopping in india
cheapest online pharmacy india: buying prescription drugs from india – IndiaMedFast
canada pharmacy online: most reliable canadian online pharmacies – canada rx pharmacy
https://indiamedfast.com/# online medicine shopping in india
northwest pharmacy canada
legit canadian pharmacy most reliable canadian online pharmacies canadian pharmacy service
lowest prescription prices online india: lowest prescription prices online india – india pharmacy without prescription
canadian pharmacy service legitimate canadian pharmacies online trustworthy canadian pharmacy
Mexican Pharm International: MexicanPharmInter – MexicanPharmInter
https://interpharmonline.shop/# canada drugs reviews
trusted canadian pharmacy
https://mexicanpharminter.com/# buying from online mexican pharmacy
best canadian pharmacy
certified canadian international pharmacy: Inter Pharm Online – best canadian pharmacy
IndiaMedFast: cheapest online pharmacy india – online medicine shopping in india
my canadian pharmacy: Pharmacies in Canada that ship to the US – reliable canadian online pharmacy
Mexican Pharm Inter Mexican Pharm Inter mexican pharmacy online order
pdacenter.ru – сервис по ремонту бытовой техники
Ремонт iPad в Чебоксарах в официальном сервисном центре PDACENTER.
Наши инженеры выполняют ремонт любой сложности по дотупным ценам!
cheapest online pharmacy india: india online pharmacy store – lowest prescription prices online india
canadianpharmacymeds certified canada pharmacy online ed meds online canada
reputable canadian pharmacy most trusted canadian pharmacies online canada drugs
http://mexicanpharminter.com/# mexican drug stores online
https://indiamedfast.shop/# order medicines online india
https://interpharmonline.com/# canadian pharmacy 365
drugs from canada
https://mexicanpharminter.shop/# Mexican Pharm Inter
https://interpharmonline.shop/# canadian drug stores
canada drugs online
http://indiamedfast.com/# india pharmacy without prescription
canadian mail order pharmacy
cheapest online pharmacy india: cheapest online pharmacy india – cheapest online pharmacy india
https://mexicanpharminter.com/# mexican drug stores online
https://interpharmonline.com/# canada pharmacy world
canadian family pharmacy
dang nh?p alo789: alo789 dang nh?p – alo 789
http://alo789.auction/# alo 789