mdc101 15 Posted April 20, 2012 Report Share Posted April 20, 2012 Hi guys How do you remove the last backslash from a string using regex? examples www.domain.com/cars/www.domain.com/ how do you get? www.domain.com/carswww.domain.com The data is all in a variable and I want to remove all the last back slashes before putting into list Quote Link to post Share on other sites
Kreatus (Ubot Ninja) 422 Posted April 20, 2012 Report Share Posted April 20, 2012 \/$That will select the last backslash Quote Link to post Share on other sites
mdc101 15 Posted April 20, 2012 Author Report Share Posted April 20, 2012 HI Kreatus Thanks for the reply I have a variable that holds all the urls I have appleid the following: set(#Urls, $replace regular expression(#Urls, "\\/$", $nothing), "Global") This has not stripped the last / In the #Urls variable their are lines that are blank because I have made them blank by removing the doamins I dont want. Ideally I want to strip the last / and the import the urls into a list to remove the duplicates #Urls: www.epa.gov/iaq/pubs/airclean.html yourhome.honeywell.com/home/Products/Air%2BCleaning/ www.aprilaire.com/index.php%3Fcategory%3Dcleaner%26znfAction%3DProductsCat www.oreck.com/Air-Purifiers www.edelbrock.com/automotive_new/mc/accessories/acc_chrome.shtml www.iqair.com/ www.epa.gov www.rabbitair.com www.oreck.com www.iqair.com yourhome.honeywell.com www.aircleaners.com www.aprilaire.com www.consumersearch.com www.ductcleaningbusiness.com www.usac-air.com www.allergybuyersclub.com www.air-purifiers-america.com www.homedepot.com www.knfilters.com/ www.filters-now.com/ www.fram.com/ www.autoanything.com/air-filters/10A50371.aspx www.filtrete.com/wps/portal/3M/en_US/FiltreteUS/Filtrete/ www.theairfilterstore.com/ www.knfilters.com www.filters-now.com www.fram.com www.autoanything.com www.airfilterusa.com www.filtrete.com www.theairfilterstore.com www.aafintl.com hepafiltersales.com www.filtersusa.com www.residential.carrier.com www.myairpurifierreviews.org/ hepa-air-purifier.org/ www.allergybuyersclub.com/all-air-purifiers.html www.allergybuyersclub.com/compare-air.html www.consumerreports.org/cro/air-purifiers.htm www.amorwares.com/air-purifier-reviews products.howstuffworks.com/air-purifier-reviews.htm airpurifiersreviews.net/ www.air-purifier-power.com/ www.myairpurifierreviews.org products.howstuffworks.com hepa-air-purifier.org www.consumerreports.org www.amorwares.com www.airpurifiers.com airpurifiersreviews.net www.air-purifier-power.com www.epinions.com www.best-air-purifier-reviews.info www.top-air-purifier-reviews.org www.all-air-purifiers.com www.airpurifiers-review.com www.airpurifier-reviews.com air-purifier-review.toptenreviews.com www.airpurifiers-report.com www.air-purifiers-america.com/ www.bedbathandbeyond.com/sg_head.asp%3FSGFN%3Dsg_airpurifiers www.rabbitair.com/ www.bedbathandbeyond.com www.target.com www.humanscale.com www.allerair.com www.sharperimage.com airnow.gov/ www.epa.gov/iaq/ www.aqmd.gov/smog/index.html airquality.weather.gov/ www.airquality.org/ www.sparetheair.org/ www.airquality.utah.gov/ airnow.gov www.aqmd.gov www.airnow.gov www.airquality.utah.gov airquality.weather.gov www.airquality.org www.sparetheair.org www.nyc.gov www.baaqmd.gov aqmd.gov www.azdeq.gov alg.umbc.edu www.health.state.mn.us pinalcountyaz.gov www.mwcog.org www.cabq.gov austinair.com/products/healthmate-series/ austinair.com/ www.achooallergy.com/austin-air.asp www.airfiltersandpurifiers.com/ www.austinairpurifiersusa.com/ www.austinairstore.com/ www.austinairpurifiers.com/ www.sylvane.com/austin-air.html austinair.com www.achooallergy.com www.austinairpurifiers.com www.austinairpurifiersusa.com www.airfiltersandpurifiers.com www.austinairstore.com www.sylvane.com www.austin-air-conditioning.com www.austinairrescue.com airbiology.com www.superpages.com austin-air.offersavehuge.com www.austinairbalancing.com austinairmanagement.com www.austinairconditioning.org www.indoorweatherpros.com www.precisionheatac.com www.austinaircleaners.com www.neverbuyanotherfilter.com www.consumerreports.org/cro/air-purifiers/buying-guide.htm www.consumersearch.com/air-purifiers www.rabbitair.com/best-air-purifiers.aspx bestairpurifier.us www.best-airpurifiers.org findairpurifier.com www.healthway.com www.thepureairstore.com www.cleanair.com/ www.epa.gov/air/caa/ www.cleanair.org/ www.cleanaircampaign.com/ www.cleanairforce.com/ www.cleanair-coolplanet.org/ www.cleanairsys.com/ www.cleanairgardening.com/ www.clean-air.com/ www.cleanair.com www.cleanair.org www.cleanaircampaign.com www.cleanairforce.com www.catf.us www.cleanair-coolplanet.org www.cleanairgardening.com www.cleanairsys.com www.clean-air.com www.cleanairamerica.com www.lung.org www.tmagroup.org www.ohioairquality.org www.commondreams.org www.cleanairtrust.org www.clean-air.org www.cleanairpartners.net www.cleanairlawncare.com www.allergybuyersclub.com/all-hepa-air-cleaners.html www.homedepot.com/buy/appliances/air-purifiers-filters/honeywell/large-room-hepa-air-cleaner-22923.html www.cleanairplus.com www.nextag.com www.guardiantechnologies.com www.kaz.com www.lennox.com store.alencorp.com www.natlallergy.com www.homedepot.com/Appliances-Heating-Cooling-Air-Quality-Air-Conditioners-Portable-Air-Conditioners/h_d1/N-bv64Z5yc1v/h_d2/Navigation%3FlangId%3D-1%26storeId%3D10051%26catalogId%3D10053%26searchNav%3Dtrue www.air-n-water.com/portable-air-conditioners.htm%3Fsize%3D-1 www.sylvane.com/portable-air-conditioners.html www.consumersearch.com/portable-air-conditioners www.target.com/c/home-home-appliances-air-conditioners-air-coolers/-/N-5xtut www.portableairshop.com www.air-n-water.com www.air-conditioner-home.com www.ajmadison.com www.portableairconditioners.us movincool.com www.northerntool.com www.frigidaire.com www.sharpusa.com Quote Link to post Share on other sites
Kreatus (Ubot Ninja) 422 Posted April 20, 2012 Report Share Posted April 20, 2012 Your best bet is to add the urls into a list. Check this removebackslash.ubot 2 Quote Link to post Share on other sites
mdc101 15 Posted April 20, 2012 Author Report Share Posted April 20, 2012 Brilliant thanks that worked perfect Quote Link to post Share on other sites
Pete 121 Posted April 20, 2012 Report Share Posted April 20, 2012 Would help if you had the http:// at the start(|www|http:\/\/|https:\/\/)([\.[:alnum:]_-]){0,4}([[:alnum:]_-]+\.)([[:alnum:]_-]\.?)([[:alpha:]]){0,3}+[\S]*(?<![^\w]) Quote Link to post Share on other sites
keiooz 1 Posted April 25, 2012 Report Share Posted April 25, 2012 Wonderful post. Thanks for sharing. http://imagicon.info/cat/5-34/vbulletin-eek.gif Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.