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 } }
mexico drug stores pharmacies: Rx Express Mexico – mexican online pharmacy
pharmacy rx world canada: Buy medicine from Canada – 77 canadian pharmacy
магазин аккаунтов маркетплейс аккаунтов
mexico pharmacy order online: mexican rx online – RxExpressMexico
Rx Express Mexico: mexican online pharmacy – mexican mail order pharmacies
drugs from canada with prescription
international pharmacy
маркетплейс аккаунтов соцсетей безопасная сделка аккаунтов
mexico pharmacy order online mexican rx online mexican online pharmacy
продать аккаунт продажа аккаунтов соцсетей
https://rxexpressmexico.com/# mexico pharmacy order online
mexico drug stores pharmacies: pharmacies in mexico that ship to usa – RxExpressMexico
RxExpressMexico: mexico drug stores pharmacies – RxExpressMexico
металлические значки москва изготовление металлического значка
Cialis sans ordonnance 24h: Tadalafil 20 mg prix sans ordonnance – Tadalafil 20 mg prix sans ordonnance tadalmed.shop
Tadalafil sans ordonnance en ligne Tadalafil 20 mg prix en pharmacie Cialis sans ordonnance pas cher tadalmed.com
Pharmacie en ligne Cialis sans ordonnance: Tadalafil 20 mg prix en pharmacie – Acheter Cialis 20 mg pas cher tadalmed.shop