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 } }
ivermectin pills: stromectol price – minocycline 100mg over the counter
neurontin 300 600 mg neurontin generic drug neurontin 200 mg
New And Innovative Concepts Happening With Bandar Toto situs toto (Drusilla)
How Auto Folding 4 Wheel Mobility Scooter Was The Most Talked About Trend Of
2023 automatic Folding Scooter
https://zithromax.company/# how much is zithromax 250 mg
zithromax tablets for sale
ivermectin malaria stromectol best price ivermectin generic cream
Rybelsus 7mg Rybelsus 14 mg price Semaglutide pharmacy price
The 10 Worst Upvc Door Panel Replacement Fails Of All Time Could Have Been Prevented replace glass panel in upvc door (fakenews.win)
buy amoxicillin over the counter uk: cheapest amoxil – prescription for amoxicillin
https://stromectol.agency/# stromectol pill
http://gabapentin.auction/# neurontin online
generic zithromax over the counter
zithromax 500mg: generic zithromax – zithromax capsules
zithromax online no prescription: zithromax for sale – zithromax 500 mg lowest price pharmacy online
You’ll Never Guess This Composite Door Panel Replacement’s Secrets Composite Door Panel Replacement
https://semaglutide.win/# cheap Rybelsus 14 mg
stromectol 15 mg buy stromectol online stromectol 3 mg tablets price
https://zithromax.company/# buy generic zithromax no prescription
https://zithromax.company/# zithromax buy online
Five Things You’re Not Sure About About French Style Fridge Freezer With Water And Ice Dispenser french door fridge freezers Uk
https://semaglutide.win/# order Rybelsus for weight loss
https://gabapentin.auction/# neurontin capsules 100mg
zithromax over the counter canada
Why Replacement Upvc Window Handles Might Be Your Next Big Obsession upvc Window repairs near Me
buy rybelsus buy semaglutide online Buy compounded semaglutide online
zithromax prescription where can i buy zithromax capsules where to buy zithromax in canada
What Is The Secret Life Of Car Seat For Newborn top rated baby car Seats, xs.xylvip.com,
rybelsus price: rybelsus generic – rybelsus generic
https://stromectol.agency/# order minocycline 50 mg
https://semaglutide.win/# rybelsus cost
5 Must-Know Toto Sites-Practices You Need To Know For 2024 안전놀이터
http://semaglutide.win/# order Rybelsus for weight loss
buy zithromax online cheap