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 } }
10 Things That Your Competitors Learn About Truck Accident Attorney Near
Me attorneys
10 Easy Steps To Start The Business Of Your Dream Patio Door Repair Business sliding glass patio doors repair (Antonietta)
Congress has passed a number of incremental legislations despite the fact that Asbestos Lawsuit
is still banned. One of them proposed legislations, the Frank R.
The 12 Most Unpleasant Types Of Windows Luton Tweets You Follow windows company near me
Who Is Upvc Windows Bedford And Why You Should Be Concerned sash window Repair bedford (https://toolbarqueries.google.co.ma)
The 10 Most Scariest Things About Truck Accident Law Firm Truck Accident Law Firm
Five Killer Quora Answers On Bmw Car Key Replacement
bmw car key replacement (http://www.google.co.uk)
A Intermediate Guide The Steps To Car Accident Litigation car accident
lawyers (https://oldchicken.kr)
What’s The Job Market For Mesothelioma Law Firms Professionals Like?
mesothelioma (ife-ifem-hrc2024.coconnex.com)
The Ultimate Glossary Of Terms About Motor Vehicle Attorney motor vehicle accident attorney
The Best Way To Explain Act Fela To Your Boss Federal employers’ Liability act
Nine Things That Your Parent Taught You About Online Famous Shopping Sites online famous Shopping sites
You’ll Be Unable To Guess Window Repair Near Me’s Tricks Window Repair Near Me (http://Www.Nuursciencepedia.Com)
15 Gifts For The Auto Accident Legal Lover In Your
Life Auto accident Lawyer
What’s The Point Of Nobody Caring About Car Accident Litigation car accident attorneys, Callum,
What’s Holding Back The Bedford Windows Industry?
glass suppliers Bedford
11 Strategies To Completely Defy Your Bmw Replacement Car Keys Bmw Key Fob
Ten Online Shop Designer Suits-Related Stumbling Blocks You Should Not
Share On Twitter Cheap Online Clothing Stores With Free Shipping Worldwide; http://Www.Pitchdecks.Tv,
You’ll Never Be Able To Figure Out This Online Shopping Uk Sites’s Secrets Online Shopping Uk Sites
How To Research Fireplace Wall Mount Online https://www.lynnbolvin.top/
Five Killer Quora Answers On Online Home Shop Uk
Discount Code online home shop uk discount code (Eulalia)
Guide To Double Glazed Window Near Me: The Intermediate Guide In Double Glazed Window Near Me double glazed window near me
Play Live Dealer Roulette For Thrilling Profit 프라그마틱 슬롯 추천
9 Things Your Parents Taught You About Single Seat Buggy single seat Buggy (https://m.emmol.net)
10 Locations Where You Can Find Best 18 Wheeler Accident Lawyer 18 Wheeler Accident Attorney
What Auto Accident Case Experts Would Like You To
Know auto accident lawyer
Excellent article on the rise of internet-based gaming. As an individual
who is deeply interested in this space, I appreciate the comprehensive analysis you
shared.
If individuals looking seeking a new platform to try out, I’ve stumbled upon a platform known as BetCryptoCasino.net.
It provides a vast array of casino titles and sports betting opportunities, supported
by virtual currencies for seamless and secure transactions.
You can explore it and see if it suits your preferences
and needs. Best regards!
Look at my web page; Crypto gaming
Ten Does Amazon Ship To Uk That Will Actually Improve Your Life online shopping sites with free international shipping [http://www.qishuashua.com.cn/]
You’ll Never Guess This Online Clothes Shopping Websites
Uk’s Tricks online Clothes shopping websites uk
What’s The Job Market For Double Glazed Window Repairs Professionals Like?
double glazed window Repairs