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 } }
mail order pharmacy india: Healthcare and medicines from India – india pharmacy mail order
safe canadian pharmacy Canada pharmacy online www canadianonlinepharmacy
mexico pharmacies prescription drugs Mexico drugstore purple pharmacy mexico price list
pharmacies in mexico that ship to usa: Mexico drugstore – best online pharmacies in mexico
http://mexicanpharmgrx.shop/# buying prescription drugs in mexico online
canadian world pharmacy: Certified Canadian pharmacies – pet meds without vet prescription canada
canadian compounding pharmacy List of Canadian pharmacies certified canadian pharmacy
buying prescription drugs in mexico mexican pharmacy mexico drug stores pharmacies
Online medicine home delivery Generic Medicine India to USA reputable indian online pharmacy
http://canadianpharmgrx.xyz/# canadianpharmacymeds com
canadadrugpharmacy com: Cheapest drug prices Canada – canada drugs online reviews
buying from online mexican pharmacy mexican pharmacy п»їbest mexican online pharmacies
best rated canadian pharmacy: List of Canadian pharmacies – canadian family pharmacy
http://kamagraiq.com/# п»їkamagra
https://sildenafiliq.xyz/# Cheap Viagra 100mg
Cialis over the counter Buy Tadalafil 5mg buy cialis pill
https://kamagraiq.shop/# sildenafil oral jelly 100mg kamagra
Buy Tadalafil 5mg: Generic Cialis without a doctor prescription – buy cialis pill
Kamagra Oral Jelly Kamagra 100mg price Kamagra 100mg price
Generic Cialis price tadalafil iq Generic Tadalafil 20mg price
Buy Tadalafil 10mg: Generic Cialis without a doctor prescription – cheapest cialis
http://tadalafiliq.shop/# Cialis 20mg price in USA
http://tadalafiliq.shop/# Tadalafil price
http://sildenafiliq.com/# Cheap Sildenafil 100mg
http://sildenafiliq.com/# best price for viagra 100mg
Buy Tadalafil 5mg tadalafil iq cheapest cialis
Cheap generic Viagra: sildenafil iq – buy Viagra over the counter
Kamagra 100mg Kamagra Oral Jelly Price cheap kamagra
Buy Tadalafil 5mg Buy Cialis online cheapest cialis
http://sildenafiliq.com/# Buy Viagra online cheap