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 } }
Имбирь — это удивительный корень, который обладает множеством полезных свойств. Он помогает укрепить иммунитет, улучшить пищеварение и справиться с простудными заболеваниями. Имбирь активно используется в кулинарии и медицине благодаря своим противовоспалительным и антибактериальным свойствам. Регулярное употребление имбиря способствует улучшению общего самочувствия и повышению жизненного тонуса.
buying prescription drugs in mexico: mexico pharmacies prescription drugs – mexican border pharmacies shipping to usa
medication from mexico pharmacy
Le gГ©nГ©rique de Viagra: Prix du Viagra en pharmacie en France – Meilleur Viagra sans ordonnance 24h
pharmacies en ligne certifiГ©es Pharmacies en ligne certifiees pharmacie en ligne fiable
See What Best Places To Buy Bunk Beds Tricks The Celebs Are Using bunk (Kathrin)
canadian pharmacy no scripts: canadian pharmacy in canada – best online canadian pharmacy
п»їbest mexican online pharmacies: mexican border pharmacies shipping to usa – п»їbest mexican online pharmacies
mexican rx online
Oh my goodness! Impressive article dude! Thank you, However I am experiencing problems with your RSS. I don’t know the reason why I am unable to subscribe to it. Is there anybody getting the same RSS problems? Anyone who knows the answer can you kindly respond? Thanks.
mexican mail order pharmacies: mexican online pharmacies prescription drugs – medicine in mexico pharmacies
https://indiadrugs.pro/# top 10 pharmacies in india
This Is A Severe Clinical Depression Symptoms Success Story You’ll
Never Remember signs of severe depression (Max)
top online pharmacy india indian pharmacy mail order pharmacy india
http://mexicanpharma.icu/# mexican mail order pharmacies
Black Electric Wheelchair 101″The Complete” Guide
For Beginners electric wheelchair price (Casimira)
This Week’s Top Stories About Upvc Window Hinge upvc window Hinge replacement near me
reliable canadian pharmacy Pharmacies in Canada that ship to the US buy drugs from canada
3 Ways The Realistic Sex Dolls Cheap Can Influence Your Life Realistic Sex Doll Young
It’s hard to come by educated people about this subject, however, you seem like you know what you’re talking about! Thanks
Feel free to surf to my webpage Daycare Near Me By State
top 10 online pharmacy in india indian pharmacy pharmacy website india
Why Situstoto Slot Is Fast Becoming The Hottest Trend Of 2024 situs toto (apk.tw)
See What Situs Terpercaya Tricks The Celebs Are Making Use Of Situs Terpercaya
mexico pharmacies prescription drugs: mexican pharma – mexican rx online
mexican online pharmacies prescription drugs mexico drug stores pharmacies buying from online mexican pharmacy
mexico pharmacies prescription drugs http://mexicanpharma.icu/# mexico drug stores pharmacies
mexico drug stores pharmacies
certified canadian international pharmacy canada online pharmacy canada pharmacy 24h
pharmacies in canada that ship to the us: Canadian Pharmacy – canadian pharmacy com
mexican online pharmacies prescription drugs mexican pharmacy buying prescription drugs in mexico online
https://indiadrugs.pro/# top 10 online pharmacy in india
http://indiadrugs.pro/# indian pharmacy paypal