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 } }
Impressive, what an discerning post! I really reveled in reading about your perspective on this theme .
It’s definitely given me a copious amount to contemplate .
I’d adore to be privy to more of your insights
, if you’re open to continuing the exchange.
By the way , have you heard of MEGA888 ? It’s an terrific virtual
gaming system with mountains of electrifying selections .
I’ve engaged in there and the endeavor has proved to be
excellent . In the event that you’re craving a fresh way to
have some amusement and conceivably succeed, I’d
emphatically endorse examining it out . Let me inform if you’re
curious and I shall provide more information !
Here is my homepage – online casino cybersecurity
15 Interesting Hobbies That Will Make You More Successful At Pragmatic Kr
프라그마틱 카지노 (Myfirstbookmark.Com)
http://erepharm.com/# ED pills non prescription
buy gabapentin online buy gabapentin online buy gabapentin online
My web page :: Find top-rated certified Daycares in your area
Rollators For Seniors Tools To Help You Manage Your Everyday Lifethe Only Rollators For Seniors Trick Every Person Should
Know Rollators for seniors
No distress at a rating of 0 viagra priligy The muscle needs protein to grow but it cannot work efficiently without the fuel and this is best provided by carbohydrate foods
https://gabapharm.com/# GabaPharm
Party Scene 오피사이트
20 Fun Facts About Stoves Retro Fridge Freezer Retro Fridge Freezer 50/50
What Is The Best Place To Research Asbestos Mesothelioma Attorney Online mesothelioma lawyer
https://furpharm.com/# buy furosemide online
buy lasix fur pharm: buy furosemide online – lasix
15 Startling Facts About Locksmith Near Me Open Now That You Never Knew Local Locksmith services
Why Online Mystery Box Doesn’t Matter To Anyone mystery box sites,
Margarito,
https://rybpharm.com/# semaglutide
Why Private ADHD Diagnosis UK Is The Next Big
Obsession private adhd assessment
rybpharm rybelsus: rybpharm – rybpharm cheap semaglutide
kamagra oral jelly Kamagra Kam Pharm kam pharm shop
buy kamagra oral jelly Kam Pharm kamagra oral jelly kampharm shop
http://furpharm.com/# furpharm
The gods themselves could carry out angelic functions, typically taking human kinds.
buy furosemide online: buy furosemide online – furpharm
The 10 Most Terrifying Things About Pellet Stoves Inserts pellet stoves inserts
Andrew Hamilton Pike, OBE, Member for Lands and Mines, Tanganyika.
Boulter denied that it had something to do with Dart, and Dart called her out for being ‘unprofessional’ because the players turned to the umpire, forcing one other denial from the winner – who mentioned that she made the gesture ‘after every match’ and that it was ‘nothing private’.
United States Air Power Basic Curtis LeMay updated the concept for the nuclear age.
Construct healthy eating habits one aim at a time!
The proper relationship between the phrases is that “radioactive atoms emit radiation.” This radioactive fallout ‘dust’ is dangerous as a result of it’s emitting alpha, beta and, most importantly, penetrating gamma radiation (similar to x-ray’s).
Vibrant, neon colors have been fashionable in the trendy wedding ceremony era; however, as traits have changed, so have the colour decisions.