Regular exepression in double quote
If I try to use regular expression inside double quotes, QTP sees the brackets as simple text rather than treating them as a regexp. What am I doing wrong? See the code below:
Name = "Test " & Replace(NOW, "[/:]", "-")
Re: Regular exepression in double quote
There is a replace method and a replace function.
- The function (which you are using in the example) is the standard VBScript replace method and does not support regular expressions
- Use the replace method of the RegExp class, see Online help on "Replace method" for an example.