Covert RegEx to String

I have the exact RegEx that I need to use. Now I’m trying to input the string variable in the Matches activity. My problem is the quotation mark’s in the RegEx are creating the issue.

The error is Expression Expected.

How can I create escape characters to make the below string a valid string type? I’ve tried a few different methods but once I make the string valid in UiPath, the RegEx doesn’t produce the correct results.

RegEx String:

((?>[a-zA-Z\d!#$%&'+-/=?^_{|}~]+\x20*|"((?=[\x01-\x7f])[^"\\]|\\[\x01-\x7f])*"\x20*)*(?<angle><))?((?!\.)(?>\.?[a-zA-Z\d!#$%&'*+\-\/=?^_{|}~]+)+|“((?=[\x01-\x7f])[^”\]|\[\x01-\x7f])")@(((?!-)[a-zA-Z\d-]+(?<!-).)+[a-zA-Z]{2,}|[(((?(?<![).)(25[0-5]|2[0-4]\d|[01]?\d?\d)){4}|[a-zA-Z\d-][a-zA-Z\d]:((?=[\x01-\x7f])[^\[]]|\[\x01-\x7f])+)])(?(angle)>)

I added double quotes in front of every double quote. Below is my final solution.

“((?>[a-zA-Z\d!#$%&'+-/=?^_{|}~]+\x20*|""((?=[\x01-\x7f])[^""\\]|\\[\x01-\x7f])*""\x20*)*(?<angle><))?((?!\.)(?>\.?[a-zA-Z\d!#$%&'*+\-\/=?^_{|}~]+)+|“”((?=[\x01-\x7f])[^“”\]|\[\x01-\x7f])”“)@(((?!-)[a-zA-Z\d-]+(?<!-).)+[a-zA-Z]{2,}|[(((?(?<![).)(25[0-5]|2[0-4]\d|[01]?\d?\d)){4}|[a-zA-Z\d-]*[a-zA-Z\d]:((?=[\x01-\x7f])[^\]|\[\x01-\x7f])+)])(?(angle)>)”

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