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 } }
Why Incorporating A Word Or Phrase Into Your Life Will Make All The Difference audi keyfob (https://atozbookmark.com/story18075690/a-look-at-the-myths-and-facts-behind-audi-advanced-key)
The 9 Things Your Parents Teach You About Rollators For
Tall Person rollators for tall person [Rodrigo]
You’ll Never Guess This Upvc Window Repairs Near Me’s Tricks upvc Window repairs
Guide To Treadmill Fold Up: The Intermediate Guide In Treadmill
Fold Up treadmill Fold Up
The Best Auto Collision Lawyer Is Gurus. Three Things car crash attorney near me
14 Cartoons About Hyundai I10 Remote Key Replacement Which
Will Brighten Your Day hyundai replacement key cost Uk
5 Killer Quora Answers On Chesterfield Corner Leather Sofa chesterfield corner leather sofa
[Margarito]
Way cool! Some extremely valid points! I appreciate you writing this write-up and also the rest of the site is really good.
What’s The Current Job Market For Affordable Couches
For Sale Professionals Like? affordable Couches for sale
A Time-Travelling Journey: What People Discussed About All Terrain Electric Wheelchairs For
Adults 20 Years Ago power chair near Me
This Is The Advanced Guide To Mazda 2 Key new mazda key cost (Bob)
Are You Able To Research Nespresso Machine Online White nespresso machines (forexmob.ru)
Where Can You Get The Best How To Get An ADHD Diagnosis Information? diagnosis Adult adhd
The 9 Things Your Parents Taught You About 2 Seater Fabric Sofa Sale 2 Seater Fabric sofa sale
5 Kia Ceed Replacement Key Leçons From The Pros 2016 kia soul replacement key
Don’t Buy Into These “Trends” Concerning Lexus Key Cutting Near
Me how much is a new lexus key fob [willysforsale.com]
11 Ways To Completely Redesign Your Replace Window Handle replacement window pane
5 Killer Quora Answers On Emergency Auto Locksmith Near Me emergency Auto locksmith Near me (whitebookmarks.Com)
The 12 Types Of Twitter Birmingham Windows The Twitter Accounts
That You Follow composite doors and windows birmingham
The 10 Most Scariest Things About Coffee Machine Coffee Beans coffee machine coffee beans (https://bookmarksystem.com/)
You Will Meet With The Steve Jobs Of The Adhd Assessment Adult Industry adhd assessment Cost Uk
(https://timeoftheworld.date/)
14 Businesses Doing A Great Job At Nescafe Coffee
1kg coffee Beans 1kg arabica
14 Smart Ways To Spend Your Left-Over Landrover Key Replacement Budget smart
The Reason Behind Replacement Key For Smart Car Has Become Everyone’s Obsession In 2023 Smart Key Car
The Most Pervasive Problems With Symptoms Of Adhd In Adults
Uk inattentive adhd symptoms [Louann]
5 Laws Anyone Working In Getting Diagnosed With ADHD Should Know how do i get diagnosed with adhd
What’s The Job Market For Couches On Sale Professionals?
couches on sale (Issac)
10 Apps That Can Help You Control Your Renault Key Card Replacement Cost renault van key replacement, minecraftcommand.science,
10 Facts About Mini Key Fobs That Can Instantly Put You In A
Good Mood car Key Reprogramming
Ten Audi A1 Keys That Really Help You Live Better Audi A1 keys (Stephany)