vendeta30 4 Posted June 14, 2017 Report Share Posted June 14, 2017 (edited) Hello I'm looking for a way to delete a part of this url: add list to list(%groups, $scrape attribute(<href=w"https://www.facebook.com/groups/*">, "href"), "Delete", "Global") https://www.facebook.com/groups/1655101604777385/16991307389571/ https://www.facebook.com/groups/359836557438198/permalink/1084847609717/ https://www.facebook.com/groups/342415669158694/permalink/170868476095717/ https://www.facebook.com/groups/1487469924880241/permalink/1086484709717/ https://www.facebook.com/groups/214671725237478/ https://www.facebook.com/groups/RomanianStreamersYoutubersMoviemakers/ https://www.facebook.com/groups/tubeplus/permalink/1086447609717/ https://www.facebook.com/groups/723009287711370/ https://www.facebook.com/groups/176652115815407/ https://www.facebook.com/groups/JTCJamOfTheMonth/Just delete "permalink/*/" This is the result that I am looking for https://www.facebook.com/groups/1655101604777385/ https://www.facebook.com/groups/359836557438198/ https://www.facebook.com/groups/342415669158694/ https://www.facebook.com/groups/1487469924880241/ https://www.facebook.com/groups/214671725237478/ https://www.facebook.com/groups/RomanianStreamersYoutubersMoviemakers/ https://www.facebook.com/groups/tubeplus/ https://www.facebook.com/groups/723009287711370/ https://www.facebook.com/groups/176652115815407/ https://www.facebook.com/groups/JTCJamOfTheMonth/Here is the solution: add list to list(%filter1, $list from text($replace regular expression(%groups, "(permalink/).*?/", ""), " "), "Delete", "Global")Another problemexample https://www.facebook.com/groups/1487469924880241/84512258621253/1086484709717/ https://www.facebook.com/groups/solotwitterofaceboook/1086484709717/what I need is to leave them in this way https://www.facebook.com/groups/1487469924880241/ https://www.facebook.com/groups/solotwitterofaceboook/have any idea of how to achieve it Final Solution add list to list(%filter5,$find regular expression(%filter4,".*groups\\/[\\d\\w\\.]+\\/"),"Delete","Global")Thank you Edited June 15, 2017 by vendeta30 Quote Link to post Share on other sites
vendeta30 4 Posted June 14, 2017 Author Report Share Posted June 14, 2017 it's just a question Quote Link to post Share on other sites
Varo 28 Posted June 14, 2017 Report Share Posted June 14, 2017 try this add list to list(%filter,$list from text($replace regular expression(%groups,"permalink/","")," "),"Delete","Global") Quote Link to post Share on other sites
vendeta30 4 Posted June 14, 2017 Author Report Share Posted June 14, 2017 try this add list to list(%filter,$list from text($replace regular expression(%groups,"permalink/","")," "),"Delete","Global") Thank you this is the resultbefore:https://www.facebook.com/groups/1487469924880241/permalink/1086484709717/ after:https://www.facebook.com/groups/1487469924880241/1086484709717/ What I'm looking for is this:https://www.facebook.com/groups/1487469924880241/ Quote Link to post Share on other sites
HelloInsomnia 1103 Posted June 14, 2017 Report Share Posted June 14, 2017 Do a replace regular expression, replace with nothing, this is the regex: permalink\/.*$ Quote Link to post Share on other sites
vendeta30 4 Posted June 14, 2017 Author Report Share Posted June 14, 2017 Do a replace regular expression, replace with nothing, this is the regex: permalink\/.*$Thanks friend, I already found the solution.: add list to list(%filter1, $list from text($replace regular expression(%groups, "(permalink/).*?/", ""), " "), "Delete", "Global") Quote Link to post Share on other sites
vendeta30 4 Posted June 15, 2017 Author Report Share Posted June 15, 2017 Do a replace regular expression, replace with nothing, this is the regex: permalink\/.*$Hello another look in against a problem more some links have this formatexample https://www.facebook.com/groups/1487469924880241/84512258621253/1086484709717/ https://www.facebook.com/groups/solotwitterofaceboook/1086484709717/ what I need is to leave them in this way https://www.facebook.com/groups/1487469924880241/ https://www.facebook.com/groups/solotwitterofaceboook/have any idea of how to achieve it Quote Link to post Share on other sites
HelloInsomnia 1103 Posted June 15, 2017 Report Share Posted June 15, 2017 Use replace regular expression again: (?<=\/)[^\/]+?\/$Edit: This will only work with this format: https://www.facebook.com/groups/solotwitterofaceboook/1086484709717/ The other format has 3 sets of numbers like that or is it a typo? If it is always numbers when it has the 3 sets let me know and I'm sure I can come up with something. Quote Link to post Share on other sites
vendeta30 4 Posted June 15, 2017 Author Report Share Posted June 15, 2017 Use replace regular expression again: (?<=\/)[^\/]+?\/$Edit: This will only work with this format: https://www.facebook.com/groups/solotwitterofaceboook/1086484709717/ The other format has 3 sets of numbers like that or is it a typo? If it is always numbers when it has the 3 sets let me know and I'm sure I can come up with something.Thanks for the data add list to list(%filter4, $scrape attribute(<href=w"https://www.facebook.com/groups/*">, "href"), "Delete", "Global") %filter4 = https://m.facebook.com/groups/DrPillaiMidbrainAssistedSearch/ https://m.facebook.com/groups/409497019224431/ https://m.facebook.com/groups/newtvboxsg/ https://m.facebook.com/groups/172519796153367/1328396980565637 https://m.facebook.com/groups/786826658104678/ https://m.facebook.com/groups/1080131648719923/ https://m.facebook.com/groups/Freemyapp/ https://m.facebook.com/groups/1059049267500384/ https://m.facebook.com/groups/hotlineterkini/ https://m.facebook.com/groups/chef.sam/ https://m.facebook.com/groups/adsenseearingwithfatima/ https://m.facebook.com/groups/290197301341759/ https://m.facebook.com/groups/AndySupport/ https://m.facebook.com/groups/GBGJB/ https://m.facebook.com/groups/gbggensan/ https://m.facebook.com/groups/1785367735038603/forsalesearchtype=for_sale&query=play&availability=available https://m.facebook.com/groups/uclatextbookproject/ https://m.facebook.com/groups/fruboxunsam/ https://m.facebook.com/groups/clarkparktotlot/ https://m.facebook.com/groups/gdgpune/ https://m.facebook.com/groups/441333919315986/ https://m.facebook.com/groups/172519796153367/ https://m.facebook.com/groups/musea.sg/ https://m.facebook.com/groups/1624162201191939/ https://m.facebook.com/groups/716547431716013/ https://m.facebook.com/groups/1406432789568601/1724942761050934/ https://m.facebook.com/groups/gugt.roma/ https://m.facebook.com/groups/577584915748399/ https://m.facebook.com/groups/905688346223350/ https://m.facebook.com/groups/hastingsrunners/ https://m.facebook.com/groups/265982430431870/ https://m.facebook.com/groups/gdgmaputo/ https://m.facebook.com/groups/utcompetitive/ https://m.facebook.com/groups/gdgdepok/ https://m.facebook.com/groups/swesupport/ https://m.facebook.com/groups/214775375528713/ https://m.facebook.com/groups/1622104458085894/1672439026385770/ add list to list(%filter5, $list from text($replace regular expression(%filter4, "(?<=\\/)[^\\/]+?\\/$", ""), ""), "Delete", "Global")Have not achieved this is the result: %filter5= https://m.facebook.com/groups/DrPillaiMidbrainAssistedSearch/ https://m.facebook.com/groups/409497019224431/ https://m.facebook.com/groups/newtvboxsg/ https://m.facebook.com/groups/172519796153367/1328396980565637 https://m.facebook.com/groups/786826658104678/ https://m.facebook.com/groups/1080131648719923/ https://m.facebook.com/groups/Freemyapp/ https://m.facebook.com/groups/1059049267500384/ https://m.facebook.com/groups/hotlineterkini/ https://m.facebook.com/groups/chef.sam/ https://m.facebook.com/groups/adsenseearingwithfatima/ https://m.facebook.com/groups/290197301341759/ https://m.facebook.com/groups/AndySupport/ https://m.facebook.com/groups/GBGJB/ https://m.facebook.com/groups/gbggensan/ https://m.facebook.com/groups/1785367735038603/forsalesearchtype=for_sale&query=play&availability=available https://m.facebook.com/groups/uclatextbookproject/ https://m.facebook.com/groups/fruboxunsam/ https://m.facebook.com/groups/clarkparktotlot/ https://m.facebook.com/groups/gdgpune/ https://m.facebook.com/groups/441333919315986/ https://m.facebook.com/groups/172519796153367/ https://m.facebook.com/groups/musea.sg/ https://m.facebook.com/groups/1624162201191939/ https://m.facebook.com/groups/716547431716013/ https://m.facebook.com/groups/1406432789568601/1724942761050934/ https://m.facebook.com/groups/gugt.roma/ https://m.facebook.com/groups/577584915748399/ https://m.facebook.com/groups/905688346223350/ https://m.facebook.com/groups/hastingsrunners/ https://m.facebook.com/groups/265982430431870/ https://m.facebook.com/groups/gdgmaputo/ https://m.facebook.com/groups/utcompetitive/ https://m.facebook.com/groups/gdgdepok/ https://m.facebook.com/groups/swesupport/ https://m.facebook.com/groups/214775375528713/ https://m.facebook.com/groups/1622104458085894/1672439026385770/No change that i'm doing wrong Quote Link to post Share on other sites
Varo 28 Posted June 15, 2017 Report Share Posted June 15, 2017 use this : add list to list(%filter5,$find regular expression(%filter4,".*groups\\/[\\d\\w\\.]+\\/"),"Delete","Global") 2 Quote Link to post Share on other sites
vendeta30 4 Posted June 15, 2017 Author Report Share Posted June 15, 2017 use this : add list to list(%filter5,$find regular expression(%filter4,".*groups\\/[\\d\\w\\.]+\\/"),"Delete","Global") Thank you friend Quote Link to post Share on other sites
the_way 52 Posted June 15, 2017 Report Share Posted June 15, 2017 i hate you regex gurus, i just can't seem to get the hang of it Quote Link to post Share on other sites
HelloInsomnia 1103 Posted June 15, 2017 Report Share Posted June 15, 2017 Varo is right but one minor tweak to that will get everything (including special characters like dashes) .*groups\/[^\/]+\/ 1 Quote Link to post Share on other sites
Varo 28 Posted June 16, 2017 Report Share Posted June 16, 2017 Varo is right but one minor tweak to that will get everything (including special characters like dashes) .*groups\/[^\/]+\/ Thanks for correction 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.