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 } }
Amo Health Care: Amo Health Care – amoxicillin 825 mg
where buy generic clomid for sale: order generic clomid no prescription – where can i buy generic clomid now
PredniHealth: prednisone 10mg canada – 5 prednisone in mexico
amoxicillin 500mg for sale uk: Amo Health Care – how much is amoxicillin prescription
get cheap clomid no prescription Clom Health clomid cheap
can i buy clomid without rx: Clom Health – how can i get generic clomid for sale
Профессиональный сервисный центр по ремонту техники.
Мы предлагаем: Ремонт духовых шкафов с выездом на дом
Наши мастера оперативно устранят неисправности вашего устройства в сервисе или с выездом на дом!
https://clomhealth.com/# where buy clomid without a prescription
http://prednihealth.com/# PredniHealth
prednisone pills for sale prednisone 20mg price PredniHealth
https://amohealthcare.store/# Amo Health Care
Amo Health Care: Amo Health Care – buy amoxicillin 500mg
https://amohealthcare.store/# amoxicillin 500mg no prescription
PredniHealth: PredniHealth – PredniHealth
PredniHealth: 20 mg of prednisone – prednisone 2.5 mg
buy prednisone without prescription PredniHealth PredniHealth
Amo Health Care: how much is amoxicillin – Amo Health Care
Amo Health Care: Amo Health Care – Amo Health Care
cost of clomid for sale: buy generic clomid without dr prescription – cost clomid tablets
http://prednihealth.com/# purchase prednisone canada
where can i get cheap clomid without dr prescription Clom Health can i buy generic clomid
https://amohealthcare.store/# amoxicillin medicine
магазин аккаунтов https://kupit-akkaunt.xyz
Amo Health Care: Amo Health Care – Amo Health Care
https://zipgenericmd.shop/# cheap Cialis online
купить аккаунт https://rynok-akkauntov.top/
https://zipgenericmd.shop/# best price Cialis tablets
buy generic Viagra online trusted Viagra suppliers cheap Viagra online
купить аккаунт магазины аккаунтов
affordable ED medication: secure checkout ED drugs – reliable online pharmacy Cialis