title: Get All Links in a Document
body: <p>Given a "normal document" in Google Docs/Drive (e.g. paragraphs, lists, tables) which contains external links scattered throughout the content, how do you compile a list of links present using Google Apps Script?</p>
  
  <p><strong>Specifically, I want to update all broken links in the document by searching for <em>oldText</em> in each url and replace it with <em>newText</em> in each url, but not the text.</strong></p>
  
  <p>I don't think the <a href="https://developers.google.com/apps-script/guides/docs#replacing_text" rel="noreferrer">replacing text</a> section of the Dev Documentation is what I need -- do I need to scan every element of the doc?  Can I just <a href="https://developers.google.com/apps-script/reference/document/body#editAsText%28%29" rel="noreferrer">editAsText</a> and use an html regex?  Examples would be appreciated.</p>