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 } }
buying prescription drugs in mexico https://mexicanpharmgate.com/ mexico pharmacies prescription drugs
15 Secretly Funny People Working In Male Masturbators Buy Male masturbators
rexall pharmacy amoxicillin 500mg: com pharm – rexall pharmacy amoxicillin 500mg
Ridiculous quest there. What occurred after? Thanks!
where can i buy amoxicillin online: com pharm – over the counter amoxicillin
Have a look at my web page :: Daycares popular listings
buy priligy: dapoxetine online – max pharm
buy amoxil: amoxil – where can i get amoxicillin 500 mg
amoxicillin 500 mg cost: amoxil com pharm – buy amoxicillin over the counter uk
buy prednisone online no prescription: Prednisone Without Prescription – prednisone 20mg price in india
rexall pharmacy amoxicillin 500mg: Com Pharm – amoxicillin 500 mg without prescription
can i buy clomid without rx: rex pharm – buy clomid without prescription
buy priligy: priligy max pharm – priligy max pharm
cost generic clomid without dr prescription: clomid – where to get clomid prices
canadian pharmacy amoxicillin: Amoxicillin for sale – amoxicillin without a prescription
prednisone 80 mg daily: prednisone – prednisone 1 tablet
how to buy clomid without rx: clomid online – where can i get clomid pill
cheap priligy: dapoxetine price – dapoxetine price
Priligy tablets: max pharm – buy priligy max pharm
buy dapoxetine online: cheap priligy – Priligy tablets
20 mg prednisone tablet: buy prednisone – prednisone for sale
dapoxetine online: max pharm – dapoxetine online
prednisone 20mg tab price: Prednisone Without Prescription – prednisone where can i buy
can i buy amoxicillin over the counter: amoxil com pharm – amoxicillin 500 mg purchase without prescription
how to get cheap clomid: clomid online – can you buy generic clomid pills
prednisone 30 mg tablet: prednisone ray pharm – prednisone 10 mg
prednisone 10mg: where to buy prednisone 20mg no prescription – buy prednisone 10mg
Priligy tablets: priligy maxpharm – dapoxetine price
buy priligy max pharm: buy priligy max pharm – max pharm
cost of prednisone tablets: prednisone – 5 mg prednisone tablets