How to extract an email and a Link from a String

Hello Everyone,

i’m struggling with the extraction of what is marked in red of the following String:

image

Please help me.
Is there any way to do it with String Manipulation instead of Regex?

Hi @snapval ,

Try the following:

For From:

InputString.Substring(InputString.IndexOf("From: ") + 6, InputString.IndexOf(Chr(10)) - (InputString.IndexOf("From: ") + 6)).Trim()

For Link:

InputString.Substring(InputString.IndexOf("Hi, press the following link ") + 29).Split(" "c)(0)

Regards,

Hi @snapval

Please use the following regular expression:

strInput = "From: abc@test.com
            To: def@test.com

            Hi, please press the following link https://gmail.com

            any concern please go to https://test.com"

strFrom = System.Text.RegularExpressions.Regex.Match(strInput, "(?<=From\:).*").Value.Trim()

strLink = System.Text.RegularExpressions.Regex.Match(strInput,"(?<=please press the following link).*").Value.Trim()

Regards
PS Parvathy