Regex.Match & Variable in argument

Hi
I have 2 variables Text1 and TD. I want to use both variables in the Regex.Match formula:

(System.Text.RegularExpressions.Regex.Match(Text1,“(?<=TD).+”).Value)
It doesn’t work as TD can’t be used in the match argument. How do I solve this?
Thank you

1 Like

Hi,

Can you try the following?

(System.Text.RegularExpressions.Regex.Match(Text1,"(?<="+TD+").+").Value)

Regards,

because you are passing variable inside the string “”
@Anonymous2

as @Yoichi mentioned you can use that method!
cheers
@Anonymous2