I am building a Rails 5.2 app. In this app I handle incoming emails. I parse the body of the email and get an array with links from the body. How can I extract a specific link/url and remove the others.
This is my array:
["code:", "request:", "https://mail.google.com/mail/vf-%5BANGjdJ9Ql923ILcJJ6A_uyjeKXxfYXWYew3ao8Hg1sDGPECPFhhZ7LPRP2-vIfW09o5MIoRmcrdxNDnD9LPYUTwTTx-LaJLIlfZ1xoGL7vyjLVlDyU8PVlv1T9Rf3p_I%5D-DWNS6pShF_p-zPxZNCLRE7RI-hI", "verification:", "https://mail.google.com/mail/uf-%5BANGjdJ-tvNwZ7q-MwbYcKwoXRJQ9XN0bTmUKs5ktJIP2gmeHTvnbBEj_ogXKy6uTz2dF6a-W6Qbz-2oJ5olVf4m5QPvpAi9nKS_6wHIcFY1WzYkQh3d_OS0o2r0dDB50%5D-DWNS6pShF_p-zPxZNCLRE7RI-hI", "visit:", "http://support.google.com/mail/bin/answer.py?answer=184973."]
I extract links with this:
URI.extract(body)
It unfortunately not only extracts links but other strings.
I want to extract the link starting with https://mail.google.com/mail/.