I am attempting to retrieve an OTP from email using regex,but it encountering null values in the results.i also checked with regex 101.
(?<=is\s).*[0-9]
if is is constant or any word is constant we can get it like this
please try this
usha
Use this website to write regex. Not all expressions in regex101 work in UiPath studio.
Find matching pattern activity output showing null values.
sometimes match activity may not work
so take assign activity
left side create a variable
and right side
use the below syntax
System.Text.RegularExpressions.Regex.Match(Str,“(?<=is\s).*[0-9]”).Value
Hope this helps
Usha
Input= "one time password is 151743"
Output= System.Text.RegularExpressions.Regex.Match(Input,"\d+").Value
Hope it helps!
Check the properties of Find Matching Patterns activity: Since there is only single match you can store the output by creating a variable in First Match.
Check below image for better understanding.
or else use this both in Assign Activity:
Input= "one time password is 151743"
Output= System.Text.RegularExpressions.Regex.Match(Input,"\d+").Value
Both Input and Output are of DataType System.String.
Hope it helps!!
Hi @chandrakala.productanalys ,
If you are still facing issues would request to share the implementation done from your end, so we could analyse and correct any parts if required.
Would also ask you to check in the Debug Panel the input data that is being supplied to Activity.
Are you recieving the one time password in the body of the mail right. In the Text to search in give currentItem.Body it will take only the body part.
Regards,
While running in debug,showing the firstmatch value as Null
Input data was asked to check and maybe also provide its screenshot to us.
I tired to add it shows like option strict on disallows late binding
I tired no Luck.Same error