Regular Expression In QTP

How to Use regular Expression in QTP programming

Here our objective is to figure out the frequency of occurance of any string.

Set re = New RegExp
re.Global = True
re.Pattern = "Viplav"
s = "Viplav is a wonderful guy and has all the more Viplav in him, I have not come acros  any other Viplav like human in my whole Viplav"
Set strMatch = re.Execute(s)
MsgBox strMatch.count

For gaining more insights in the automation using QTP log on to below url :

Automation Testing Using QTP


Post a Comment

Note: Only a member of this blog may post a comment.