Micro Focus QTP (UFT) Forums
How to use regular expression for this? - 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: How to use regular expression for this? (/Thread-How-to-use-regular-expression-for-this)



How to use regular expression for this? - viv_karthy - 04-28-2009

Hi
Need help on varabilizing this expression using regular expression:

"20090509WS 238YYCYQR CACARXXFR0149 200905090840200905090953 "

Thanks in advace


RE: How to use regular expression for this? - viv_karthy - 04-28-2009

Just to eloborate a bit further on my post:
Code:
Browser("WestJet - Low air fares").Page("WestJet - Low air fares").WebRadioGroup("flightId1").Select "20090505WS   238YYCYQR                            CACARDDXR0119 200905050840200905050953                        "
Browser("WestJet - Low air fares").Page("WestJet - Low air fares").WebRadioGroup("flightId1").Select "20090505WS   188YYCYQR                            CACARGGFR0159 200905051205200905051318                        "
Browser("WestJet - Low air fares").Page("WestJet - Low air fares").WebRadioGroup("flightId1").Select "20090505WS   212YYCYQR                            CACARDDXR0119 200905051645200905051758


It is the last part of the above mentioned scrip for which Reqular Expression needs to be used. ie
Code:
Select "20090505WS   212YYCYQR                            CACARDDXR0119 200905051645200905051758



RE: How to use regular expression for this? - Ankur - 04-29-2009

Which part is constant in your requirement?

Assuming WS YYCYQR CACARDDXR is constant, the reg exp should take the form:

[date]WS [3digits]YYCQR CACARDDXR[4digits] [date][again n digits]

Check which part in the above exp is constant or can be parametrized, then it should be doable.