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 } }
KamagraKopen.pro: kamagra jelly kopen – kamagra kopen nederland
Generic 100mg Easy: Viagra without a doctor prescription Canada – buy generic 100mg viagra online
kamagra jelly kopen Kamagra Kopen Officiele Kamagra van Nederland
http://generic100mgeasy.com/# Generic100mgEasy
http://generic100mgeasy.com/# cheapest viagra
https://generic100mgeasy.shop/# Generic 100mg Easy
https://generic100mgeasy.com/# buy generic 100mg viagra online
cialis without a doctor prescription: Tadalafil Easy Buy – Cialis without a doctor prescription
kamagra 100mg kopen: kamagra pillen kopen – Kamagra Kopen
kamagra jelly kopen: Kamagra – kamagra kopen nederland
https://tadalafileasybuy.com/# TadalafilEasyBuy.com
KamagraKopen.pro KamagraKopen.pro kamagra pillen kopen
Tadalafil Easy Buy: cialis without a doctor prescription – cialis without a doctor prescription
https://kamagrakopen.pro/# kamagra pillen kopen
Top strategies for winning every game Lucky Cola
https://kamagrakopen.pro/# Officiele Kamagra van Nederland
kamagra 100mg kopen: KamagraKopen.pro – kamagra 100mg kopen
KamagraKopen.pro: Kamagra Kopen – KamagraKopen.pro
Generic100mgEasy buy generic 100mg viagra online sildenafil 50 mg price
Kamagra Kopen Online: kamagra jelly kopen – kamagra gel kopen
http://tadalafileasybuy.com/# Cialis without a doctor prescription
https://generic100mgeasy.shop/# Generic 100mg Easy
Профессиональный сервисный центр по ремонту бытовой техники с выездом на дом.
Мы предлагаем:ремонт крупногабаритной техники в москве
Наши мастера оперативно устранят неисправности вашего устройства в сервисе или с выездом на дом!
buy generic 100mg viagra online Generic100mgEasy buy generic 100mg viagra online
Cheap Viagra 100mg: Generic 100mg Easy – Generic 100mg Easy
купить медицинские анализы клинический анализ купить
http://tadalafileasybuy.com/# Tadalafil Easy Buy
kamagra gel kopen: Kamagra – KamagraKopen.pro
Tadalafil Easy Buy: TadalafilEasyBuy.com – Tadalafil Tablet
Generic 100mg Easy: Generic 100mg Easy – buy generic 100mg viagra online