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 } }
The Best Single Buggy For Sale Tricks To Transform Your Life Best Single Buggy
9 Lessons Your Parents Taught You About Upvc Window Repairs Near Me upvc Window repairs near me
15 Shocking Facts About Online Charity Shop Uk Clothes That You’ve Never Heard Of
Colorful Magnetic Hall Passes; Bridget,
What’s The Job Market For 18-Wheeler Accident Lawyer Professionals Like?
law
5 Killer Quora Answers On Best Lightweight Single Stroller Best Lightweight Single stroller
10kg Washers 101: This Is The Ultimate Guide For
Beginners https://www.023456789.xyz/
A Step-By Step Guide For Choosing The Right Bedford Door Panels Door fittings Bedfordshire
10 Best Mobile Apps For Small Fridge http://www.36035372.xyz
The 10 Scariest Things About Treating Anxiety
Disorders Treating Anxiety Without Medication
You’ll Never Guess This Online Shopping Sites Top 7’s Tricks online shopping sites top 7
The Most Convincing Proof That You Need Uk Online Shoe Shopping Websites shopping online
9 Things Your Parents Teach You About Upvc Window Repair Upvc Window Repair
You’ll Never Guess This Double Glazing Doors Near Me’s Benefits
Double glazing doors
You’ll Be Unable To Guess Upvc Window Repairs Near Me’s Secrets Upvc window repair
Double Glazing Companies Near Me Techniques To Simplify Your Everyday Lifethe Only Double Glazing Companies Near Me Trick That Every Person Must Learn double glazing companies near me (Layla)
สโบเบ็ตเป็นเว็บพนันที่มีความเป็นที่นิยมอย่างแพร่หลายในเอเชียและทั่วโลก สโบเบ็ตเปิดให้บริการตั้งแต่ปี 2532 และได้รับใบอนุญาตจากรัฐบาลเกาหลีใต้ สโบเบ็ตมีเกมคาสิโนออนไลน์ที่หลากหลาย
เช่นสล็อต เกมรูเล็ต แบล็คแจ็ค และอื่นๆ นอกจากนี้ยังมีการเดิมพันกีฬา บอลเดิมพัน บาสเกตบอล และกีฬาอื่นๆ มากมาย สโบเบ็ตมีการให้บริการที่ปลอดภัยและดี พร้อมด้วยระบบฝากถอนที่ง่ายและรวดเร็ว หากคุณชื่นชอบการเล่นการพนัน สโบเบ็ตอาจเป็นเว็บไซต์ที่คุณต้องการลองเข้าเล่นค่ะ
Feel free to surf to my webpage; เว็บคาสิโนออนไลน์ที่มีการรับประกันความปลอดภัยและความน่าเชื่อถือสูงสุด (gitlab.freedesktop.org)
3 Reasons Commonly Cited For Why Your Cerebral Palsy Lawsuit Isn’t Working (And How To
Fix It) cerebral palsy Lawsuits
10 No-Fuss Methods For Figuring Out The Semi Truck Legal In Your Body.
semi truck Accident lawsuits
5 Window Repair Birmingham Myths You Should Avoid sash Windows birmingham (app.aspell.net)
15 Best Pinterest Boards To Pin On All Time About Cheap Fridges Joanne
The Three Greatest Moments In Windows Bedford History
aluminum window repair
15 Gifts For The 18 Wheeler Truck Accident Attorney Lover In Your
Life 18 wheeler accident lawyer
7 Useful Tips For Making The Most Out Of Your Window Repairs Upvc window repairs
15 Reasons To Not Be Ignoring Sash Windows Repair https://www.257634.xyz/8tt4-87jt-94k-ac5zyr-3b8ad9k-3239/
The 10 Scariest Things About Upvc Door Repairs Near Me Upvc Door repairs near me
Speak “Yes” To These 5 Single Buggy Tips cheap single Buggy
I really like reading an article that will make men and women think. Also, thank you for permitting me to comment.
เมื่อพูดถึง “Pretty Gaming”, คุณจะนึกถึงความสนุกและความท้าทายที่ไม่ขาดสาย.
เกมเหล่านี้เอื้อผลแด่ความงดงามของกราฟิกและการออกแบบที่น่าสนใจ.
ทั้งหมดนี้ทำให้ผู้เล่นหลงรักใน Pretty Gaming.
ไม่ว่าคุณจะเป็นผู้เล่นที่ยังไม่มีประสบการณ์หรือมืออาชีพ, Pretty Gaming มีทั้งเกมที่เหมาะสำหรับทุกระดับความชำนาญ.
การเล่นเกมเหล่านี้จะทำให้คุณรู้สึกยิ่งใหญ่.
เพราะฉะนั้น, Pretty Gaming คือที่สุดของความสนุกและความงดงามในโลกของเกม.
Review my web page คาสิโนออนไลน์ถูกกฎหมาย
5 Killer Quora Answers On Single Strollers That Connect Single strollers that connect
Nine Things That Your Parent Teach You About Best Online Shopping Sites London best online shopping sites London