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 } }
http://generic100mgeasy.com/# buy viagra here
https://kamagrakopen.pro/# Officiele Kamagra van Nederland
https://tadalafileasybuy.shop/# cialis without a doctor prescription
Kamagra kamagra kopen nederland Kamagra
http://tadalafileasybuy.com/# TadalafilEasyBuy.com
Kamagra Kopen: kamagra pillen kopen – KamagraKopen.pro
https://tadalafileasybuy.shop/# TadalafilEasyBuy.com
MexicanPharmInter: mexican pharmacy online store – reliable mexican pharmacies
canadian pharmacy 24h com: most reliable canadian online pharmacies – canadian pharmacy 24 com
https://interpharmonline.shop/# canadian drug prices
https://mexicanpharminter.shop/# buying from online mexican pharmacy
order medicines online india IndiaMedFast online medicine shopping in india
http://mexicanpharminter.com/# reliable mexican pharmacies
canadian drugs online
pdacenter.ru – сервис по ремонту бытовой техники
Ремонт стиральных машин в Твери в официальном сервисном центре PDACENTER.
Наши инженеры выполняют ремонт любой сложности по дотупным ценам!
legit canadian pharmacy: InterPharmOnline.com – canada rx pharmacy
https://interpharmonline.shop/# canada pharmacy online
cheapest online pharmacy india lowest prescription prices online india india pharmacy without prescription
canadian pharmacy meds: fda approved canadian online pharmacies – safe online pharmacies in canada
http://indiamedfast.com/# IndiaMedFast.com
order medicines online india: IndiaMedFast.com – online medicine shopping in india
canadian pharmacy ltd: canada pharmacy no prescription – canadian world pharmacy
Mexican Pharm International: MexicanPharmInter – Mexican Pharm Inter
https://interpharmonline.com/# safe canadian pharmacy
http://indiamedfast.com/# India Med Fast
canadian pharmacy service
reliable mexican pharmacies: MexicanPharmInter – mexican pharmacy online store
canadian pharmacy 1 internet online drugstore: Cheapest online pharmacy – canada drugstore pharmacy rx
best canadian online pharmacy: fda approved canadian online pharmacies – canadadrugpharmacy com
77 canadian pharmacy legitimate canadian pharmacies online legit canadian pharmacy
https://indiamedfast.com/# buying prescription drugs from india
https://indiamedfast.shop/# India Med Fast