Hi i have the above outlook mail i need to extract Verification Code number. Can anyone please help me in extracting only that Number.
Thanks in advance
Hi i have the above outlook mail i need to extract Verification Code number. Can anyone please help me in extracting only that Number.
Thanks in advance
Assuming the verification code length is 5.
string strOutlookBodyText = “Body of the Email”
int Index = strOutlookBodyText.IndexOf("Verification Code:")
int iVerificationCode = strOutlookBodyText.SubString(Index + "Verification Code:".Length + 1, 5)
Regards,
Karthik Byggari
Use Matches activity with pattern as (?<=Verification Code:[ ]+)\d+
Just to make sure, once result is retrieved, use trim to remove the whitespace if there any.
This will also work fine even if the verification code length changes.
Hope this is helpful!
Can someone pls help me bot takes the previous verification code instead of latest code.
Hey @KarthikByggari
What changes we need to do if the body looks like this?
My verification code string says “re.ad” by using the method above and the code’s length is 6 and it might change in future as well. So just wanted to know code structure for that as well if possible.
Thanks in advance
You can use the following regex pattern to get the verification code -
Regex pattern: [0-9]{6,6}
[0-9] - Digit only
{6,6} - Min & Max - only allows 6 digit number.
If you want to allow 5 digit number, the pattern will be [0-9]{5,5}
Regards,
Kartheek