x <- "https://w...content-available-to-author-only...c.gov/Archives/edgar/data/1347185/000134718517000016/0001347185-17-000016-index.htm/exh1025730032017.xml" sub("^(.*/).*/(.*)", "\\1\\2", x)
Standard input is empty
[1] "https://w...content-available-to-author-only...c.gov/Archives/edgar/data/1347185/000134718517000016/exh1025730032017.xml"