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 } }
lipitor 40: Atorvastatin 20 mg buy online – buy generic lipitor online
common side effects of tamoxifen: Purchase Nolvadex Online – nolvadex 10mg
10 Untrue Answers To Common Fold Away Treadmill Questions Do You Know The Correct Answers?
Treadmills Fold Up
http://tamoxifen.bid/# tamoxifen lawsuit
buy cytotec pills http://cytotec.pro/# п»їcytotec pills online
lasix 20 mg
buy cytotec online http://tamoxifen.bid/# tamoxifenworld
buy furosemide online
There Is No Doubt That You Require G Spot Vibrater G Spot Vibrators
How To Explain Upvc Window Repairs To Your Grandparents Upvc
window repairs near me – https://cornpoland94.werite.net –
My blog – Daycares By Category
There is definately a great deal to know about this subject. I really like all of the points you have made.
Feel free to surf to my page; Atlanticusfunding.Com
my website – poker Online
Feel free to visit my web blog PokerTube
Feel free to visit my web site Explore Daycares Locations
10 Things We Love About Electric Fire Place Suite black electric
fire suite (Zoe)
Hello, I do believe your site could be having browser compatibility problems. When I take a look at your web site in Safari, it looks fine but when opening in Internet Explorer, it’s got some overlapping issues. I just wanted to give you a quick heads up! Besides that, excellent site.
Why People Don’t Care About General Anxiety Symptoms anxiety treatment symptoms (https://clashofcryptos.trade/)
9 Things Your Parents Teach You About Leather Couch
With Chaise leather couch with Chaise (eugosto.Pt)
The 10 Scariest Things About Double Glazed Window Repairs
Near Me window repairs near me
You’ll Be Unable To Guess Double Glazed Windows Repair Near Me’s Secrets windows repair near me
What’s The Current Job Market For Generalized Anxiety Disorder
Gad Professionals Like? Generalized Anxiety Disorder
The 10 Most Dismal Male Mastubators Errors Of
All Time Could Have Been Prevented best auto masturbator – Jacquie,
Your Worst Nightmare Concerning Replace Glass In Window Come
To Life Front Door Glass Replacement
indian pharmacy online: Best Indian pharmacy – pharmacy website india
Online medicine order: Indian pharmacy international shipping – indian pharmacies safe
15 Reasons Why You Shouldn’t Ignore Pills To Treat Anxiety anxiety attack natural treatment
Why Jackpot Slots Isn’t As Easy As You Think Themed Slots
purple pharmacy mexico price list: Purple pharmacy online ordering – best online pharmacies in mexico
This Is The History Of Nissan Micra Key Replacement In 10 Milestones replacement key for nissan juke
best online ed pills: ED meds online with insurance – online ed medication