Hi everyone can you please assist me here, so the bot is reading from the email a policy number provided using regex:
The structure is like this usually -

but now the bot does not know when it is like this :

it just reads whatever is after ‘Policy or claim Number’ which will lead to incorrect results.
So I want a condition that says if that word after policy number comes , value for policy number should be null or non-existing.
I have a condition that checks if there is a policy number value or not


Can you share current regex pattern ( or expression)?
Match.Success property or Negative Lookahead might be able to used.


Hi @Anelisa_Bolosha ,

Maybe if the policy number is only digits, you could change the condition to the below :


Else, we can use a different regex with more Strict on the numbers - \d+

1 Like

Hi @Yoichi Thank you for your reply,


The following pattern may be better because it returns only numeric characters. (if there is unexpected string, the result will be empty)

(?<=Policy Or Claim Number:\s*)\d+


1 Like

Hi @supermanPunch
The policy is not all digits sometimes


So sometimes they like that

@Anelisa_Bolosha ,

In that case, Maybe the way the data is being sent needs to be standardized. As it is sent from an email, it could be told or mentioned to the sender that each of the fields need to be separated by a new line, so as to be able for the RPA to understand the correct value for the corresponding field.

A definite pattern would help, moreover if you still think there is a definite pattern already followed, we may need to check on the sample data completely that you might be receiving from the emails.

is there a way to have a regex to say, ignore if the word ‘Clicks’ comes up after ‘Policy or Claim Number:’ ?

alright will look into that

Or a condition to say if after ‘policy’ there is a ‘clicks’ string then it should ignore that and take it as null?
Is that poossible

Thank you, so now there is a proper structure for it, policy number should only be numeric, so anything other than numeric it should be a null value and move on to another activity.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.