So I have this small script that uses getPlainBody() to get the message body of a GmailApp thread, that part is fine and working. Somewhere inside that body is a URL, let's say "http://www.aohell.com/tacofriedrice"
Is it possible to have a script find and pull that entire link just by searching for part of it?
For example, I want the script to search the message body for "http://www.aohell.com" and if it finds that match, it will pull the rest of the URL "http://www.aohell.com/tacofriedrice" and save it to a variable.
I had found a method ".findText("http://.*/")" while looking around existing posts, but findText doesn't appear to actually be an existing google apps function according to the error message. Afterwards what I found suggests to use .getElement().asText().getText() but I've got no idea if those will work either since findText() doesn't.