Regex not working to extract loan amount in REFramework

in my multi assign when i use Regex.Match(in_TransactionItem, “(?<=Loan Amount Requested:\s*$)(\d+)”).Value in value to option it encounters an error
Error Error ERROR Validation Error BC30652: Reference required to assembly ‘System.Net.Mail, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51’ containing the type ‘MailMessage’. Add one to your project. Framework/Process.xaml

Use below regex, I replaced ( ) to (")

Regex.Match(in_TransactionItem, "(?<=Loan Amount Requested:\s*)\d+").Value

If you are using Email activities for reading or sending email then import UiPath.Mail.Activities package from Manage Packages. This will resolves your mention error.

Hi @Joshua2
Welcome to UiPath,

pls install from manage package- System.Net.Mail
Then use below:
Regex.Match(in_TransactionItem, “(?<=Loan Amount Requested:\s*)\d+”).Value

Happy Automation

i have downloaded the dependencies and imported name space still i encounter this Error ERROR Validation Error BC30652: Reference required to assembly ‘System.Net.Mail, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51’ containing the type ‘MailMessage’. Add one to your project. Framework/Process.xaml

You have a random variable somewhere that is causing the issue, its not the Regex.

The error says you have a variable which is of type ‘MailMessage’ somewhere, and it needs a reference to that.

Find that variable and remove it, then try removing the unused imports on that workflow to properly clean it up.

If you are using the MailMessage variable, then there is something else to fix, but sounds like you aren’t.

Then System.Net.Mail - pls try to upgrade or Downgrade the package .

@Joshua2 ,

Welcome to the @UiPath_Community . There might be a dependency issues between 2 or more packages(Seems to be the case with newer versions of a few dependency packages). Try to downgrade the dependencies like UiPath.System.Activities and any other dependencies that you have.

@Joshua2

Welcome to the community

I echo with @Jon_Smith ..also to support it its failing on multi assign ao anything in multi assign might be failing not only regex..or your transactionitem type might be mailmessage which might be causing the issue again..but I doubt as the regex match needs a string so it would have thrown a compilation error there..so try checking the variables which are present

Cheers