Micro Focus QTP (UFT) Forums
Can't we directly compare against regexp - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Regular Expressions (https://www.learnqtp.com/forums/Forum-UFT-QTP-Regular-Expressions)
+--- Thread: Can't we directly compare against regexp (/Thread-Can-t-we-directly-compare-against-regexp)



Can't we directly compare against regexp - anu05446 - 03-02-2014

if "Document 12456 was posted" = "Document \d+ was posted" Then   Print "Yes"else    print "No"end ifthe above code shows No, can't we directly compare against regexp??? I know how to match using RegExp Object, but isn't the direct comparison possible??is there any property we need to set as True??I'm using UFT11.5.


RE: Can't we directly compare against regexp - guin.anirban - 03-05-2014

Regular expression is not used for comparison rather it is used to identify objects of similar patter.

Why I am not allowing to post any reply?


RE: Can't we directly compare against regexp - Parke - 04-19-2014

anu05446:

Anshoo Arora, in Relevant Codes, demonstrates how to use regular expressions for select method for a listbox.
http://relevantcodes.com/regular-expressions-with-select-method-listbox/
You might be able to modify his code to what you need.

He has another nice article at http://relevantcodes.com/qtp-all-about-the-description-object-description-create/

hth,

Parke