Regex using variables giving empty results

Hello,

I have already browsed the topics here but my issues is still unresolved.

I am trying to use a Matches using two variables.
First I have assigned the whole expression in a string:

image

Then I have put that whole expression in a Regex Matches activity.

When I run the code, the variables are replaced by the correct actual values.

When I input the actual values directly in the Regex Match, I got proper results.
However, when I put the expression with the variables, it is empty.

Please note that my input text has line breaks (text for example). In this case, it is “LALALAND” that I am trying to extract:
4070 AVE XYZ 164P500

LALALAND, QC, H0A 3R0

Thanks

Hi,
Can you check if your variable contains extra white spaces?

or

Can you try the following expression? This will remove extra white spaces from each variable.

"(?s)(?<="+aTrailerNumber.Trim+").*?(?="+xProvince.Trim+")"

Regards,

Hello,

I appreciate your feedback. It is till not working.

Thanks,

Mame