Logical And, OR conditions in Regex based Extractor

How can I use Logical conditions in my Regex Extractors? I was doing a workflow and here is what I encountered
In two forms I can have the same field as 2 different yet similar names like:
Commission File No. XXXX
Commission File Number: XXXX

tried to put a regex which would ether take Commission File No. or Commission File Number:

So regex would be

(Commission File No.|Commission File Number:)\s*\d{3}-\d{5}

But since (Commission File No.|Commission File Number:) is in braces it gets highlighted as yellow and it means extracted. I only want to extract the Commission number and not the label.
If I dont use braces then it becomes

Commission File No.|Commission File Number:\s*\d{3}-\d{5}

which is an OR condition between “Commission File No.” and “Commission File Number:\s*\d{3}-\d{5}”

How do we resolve this?

@prince.adlakha Welcome to our uipath community.
Here ia a solution

(?:(?<=Commission File No. )|(?<=Commission File Number: ))\s*\d{3}-\d{5}
1 Like