Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

regular expressions in QuickTest Pro

Status
Not open for further replies.

herisud

Programmer
Aug 20, 2005
3
CA
I can't get the regular expression to work in qtp, I'm not sure if I'm using qtp wrong or regexps wrong:

target string: "11:32:13 - W - Duplicate insertion : SHAU 100004"

regexp: "Duplicate instertion"

I am doing this within a checkpoint that references the global datasheet, and I did remember to check the 'regexp' checkbox.

The Mercury help suggested that I try "*.Duplicate Insertion*." which didn't work and makes no sense to me anyways.

Any suggestions would be appreciated
 
Mercury's help is suggesting you use wildcards (*s) to indicate that your string is contained within the sentence rather than is the complete sentence.

Based on your target string, I'd say that Mercury's approach is correct, but you need to remove the full stops.

Try "*Duplicate insertion*" and see how you go.

Cheers,
Dave

Probably the only Test Analyst Manager on Tek-Tips...therefore whatever it was that went wrong, I'm to blame...

animadverto vos in Abyssus!

Take a look at Forum1393!
 
the suggestion from mercury is not right. they got the '.' and '*' mixed up. it should be:

"*.Duplicate Insertion.*"

If this doesn't work, try to put a single space before and after the string like:

"*. Duplicate Insertion .*"

cheers,
Kev
 
That doesn't look quite right - the regex pattern for zero or more of any character is ".*", so if you put that either side of the string you want to match for, you get;

".*Duplicate Insertion.*"

or, with spaces either side:

".* Duplicate Insertion.* "

Dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top