![]() |
Regular Expression - 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: Regular Expression (/Thread-Regular-Expression--1112) |
Regular Expression - rajeshvelur - 10-03-2008 Hi, I am testing Windows Forms app, with Test Advantage add-in. Have a question, how to use reg exp for the following: "10/2/2008 4:24:05 PM" Thanks Raj RE: Regular Expression - kishoreinchennai - 10-03-2008 hi Do you want to validate the date and time or just to check if it is of the above format. the Simplest way to do this is : Code: Set objRegExpr = CreateObject("VBScript.RegExp") RE: Regular Expression - sandeep n - 10-10-2008 'Just try this for date and i think this is the longest way which i ever saw ![]() ![]() Code: dim abc,def,ghi,j in same way try for time def(1) RE: Regular Expression - sandeep n - 10-10-2008 here no were u r using objregexpr, does that really needed?? RE: Regular Expression - kishoreinchennai - 10-17-2008 yes actually not needed copy paste error :-) RE: Regular Expression - surya_7mar - 11-29-2008 If you using OR chage the object to regular expressionwth the value below and if it is descriptive use tehe below on the code.. For "10/2/2008 4:24:05 PM" Regular Exp: "\d?\d/\d?\d/\d\d\d\d \d?\d:\d?\d:\d?\d .M" or "\d?\d/\d?\d/\d\d\d\d \d?\d:\d?\d:\d?\d AM|\d?\d/\d?\d/\d\d\d\d \d?\d:\d?\d:\d?\d PM" |