i'm trying to extract the text only content from a web page and displayed and i use the HtmlAgilityPack to do the text extraction but the text return with the javascript and css text and i don't want this so i'm trying to detect the { } delimiter to remove all string within the { } delimiter to delete all javascript and css text from the returned text and i use a regex to do that but is not working because i have a nested { } and this is my regex that i'm trying with :
string regex = "\t|\n|<.*?>|(\\[.*\\])|(\".*\")|('.*')|(\\(.*\\))|{\\[.*\\]}|{\".*\"}|{'.*'}|{\\(.*\\)}";
TextArea1.Value = Regex.Replace(s, regex, "");
Input Text:
Los Angeles Times - California, national and world news - Los Angeles Times;},svginImg:function;a.onload=function{var a=navigator.userAgent||navigator.vendor||window.opera;return/;},isIE9:function==9;}},notmobileCalccheck:function;a.style.cssText=;return !!a.style.length;},isAndroidBrowser:function{var a=navigator.userAgent||navigator.vendor;return/android/i.test&&!window.opera;},isSupportedBrowser:function&&!window.opera;},getScreenWidth:function;},isSupported:function isSupported{a=sessionStorage==;}else{try{a=this.supportsSvg{a=false;}}if<=8;}};trb.utils.redirect=function;b.name=;document.body.appendChild;b.submit;if{localStorage=d;}else{for{var c={};for{c;}return null;},remove:function remove;localStorage.removeItem{var b=localStorage;if;a=),f;for;}}},remove:function remove{a.trb=a.trb||{};trb.data=trb.data||{};trb.data.isMobile=trb.browsersupport.isMobile;trb.data.isIE9=trb.browsersupport.isIE9;trb.data.facebookAppId=;trb.data.parentSectionPath=);}if;}trb.data.isSectionFront=true;if;}trb.data.videos={};trb.data.videos.ndnFallbackJsURL=;trb.data.initialpathname=;trb.data.pages=trb.data.pages||{};trb.data.pages={};trb.data.pages.unsupportedBrowserPath=;trb.svg={};trb.svg.data={};trb.svg.data.svgStrings={};trb.svg.data.svgStrings.logoShort=;trb.svg.data.svgStrings.logo=;trb.svg.data.svgStrings.loadingCircle=;trb.svg.data.map={mastheadLogo:{colors:{PRIMARY_COLOR:},string:trb.svg.data.svgStrings.loadingCircle}}; { background: #404040; } .trb_allContentWrapper { background: #333; }