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 } }
11 Ways To Totally Block Your Mitsubishi Outlander Key Replacement
Mistubishi Cars
This Is The Ugly Truth About Window Services London install
10 Things We Do Not Like About Malpractice Attorneys malpractice law firms
10 Facebook Pages That Are The Best Of All Time About Lost Car
Key Lost Electric Key
Bunk Beds Single And Double Tools To Make Your Everyday Lifethe Only Bunk
Beds Single And Double Trick That Every Person Must Know bunk beds single and double
A Step-By-Step Instruction For Motor Vehicle Legal
motor vehicle accidents
Private Assessments For ADHD Explained In Less Than 140 Characters Private Adhd Assessment Right To Choose
10 Untrue Answers To Common Sofa Couch L Shape Questions: Do You
Know The Right Answers? l shaped sofa bed couch – https://H6h2h5.wiki/,
I revealed your blog post to be a compelling and perceptive examination of the
up-to-date state of the market . Your assessment of
the crucial changes and problems encountering companies
in this sector was outstandingly compelling .
As an zealous adherent of this matter , I would be pleased
to delve deeper into this debate further .
If you are inclined , I would graciously urge you to
delve into the thrilling options on offer at WM CASINO.
Our platform offers a state-of-the-art and fortified
context for connecting with simpatico enthusiasts and
procuring a cornucopia of insights to enhance your insight of
this fluid industry . I eagerly await the potential of partnering
with you in the proximate future
my blog wm casino online (george-schaefer.technetbloggers.de)
Does Technology Make Replacement Windows Crawley Better Or Worse?
hotel Glass repair
Online Shopping Uk Electronics Techniques To Simplify
Your Everyday Lifethe Only Online Shopping Uk Electronics Trick That Everybody
Should Know online shopping uk electronics – Kisha,
Malpractice Attorneys: 11 Thing You’re Forgetting
To Do malpractice Law firm
5 Killer Quora Answers On Cheap Online Electronics Shopping Uk cheap online electronics shopping uk
“Ask Me Anything:10 Answers To Your Questions About Upvc Front Doors replacing lock in upvc door
Do Not Make This Blunder When It Comes To Your Window And Door Repair Near
Me installing
How Window Companies Luton Altered My Life For The Better window replacement Luton
Adult Adhd Assessment Near Me Techniques To
Simplify Your Everyday LifeThe Only Adult Adhd Assessment Near
Me Trick Every Individual Should Learn adult adhd assessment
near me (Elaine)
Car Accident Lawyer 101 A Complete Guide For Beginners Car Accident Attorney (Numeracy.Wiki)
The 10 Most Scariest Things About What Causes Mesothelioma
Other Than Asbestos http://www.0270469.xyz
See What Fela Lawsuits Tricks The Celebs Are Using Lawsuits
Replacement Upvc Door Handles’s History Of Replacement Upvc Door Handles In 10 Milestones upvc front Doors
Five Comfortable Mobility Scooters Projects To Use For Any Budget foldable
lightweight scooters (Johnathan)
9 Lessons Your Parents Teach You About Best Online Clothing
Sites Uk online clothing sites uk (Christel)
5 Arguments Erb’s Palsy Lawyers Is Actually A Good Thing
Erb’s Palsy Lawsuits
Do You Think Double Glazed Windows Crawley Ever Be The King Of The
World? Window repair near me
How To Create An Awesome Instagram Video About How To Diagnosis ADHD
9326527.xyz
7 Secrets About Dangerous Drugs Attorneys That No One Will Tell You Dangerous Drugs Lawsuit
The 9 Things Your Parents Taught You About Best Online
Clothing Sites Uk Online Clothing Sites Uk
ADHD Titration UK Tools To Make Your Daily
Lifethe One ADHD Titration UK Trick That Every Person Should Be Able To Adhd Titration Uk
You’ll Never Be Able To Figure Out This Double Glazed Units Near
Me’s Secrets double glazed units near me