Variables inside Regular expressions
How to use variables inside Regular expressions in QTP?
Let's we have string "abc, 5675: xyz" and the number 5675 changes.
I want to write something like
for variable number = 6745
RegEx.Pattern = "abc\,\s$number$:\sxyz"
But it does not work.
Help me please,
Re: Variables inside Regular expressions
I found solution. As long as we need to give a string to
RegEx.Pattern it will be just
RegEx.Pattern = "abc\,\s"&number&":\sxyz"
So it's really simple.
If someone knows another solution may be for more complex
cases please post it.