Micro Focus QTP (UFT) Forums
RegEx for a child objects - 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: RegEx for a child objects (/Thread-RegEx-for-a-child-objects)



RegEx for a child objects - SBsteven - 11-16-2009

I need to write a regular expression for this:

Code:
<SPAN>Employer Service Rep</SPAN>


This is what I am using, is this correct?

Code:
<SPAN>.*</SPAN>

Thanks,
SBsteven
Nevermind, I got it now....

Here is what I do want to filter on:

Code:
<SPAN>Employer Service Rep</SPAN>

Here is what I DO NOT want:

Code:
<SPAN style="CURSOR: hand; COLOR: blue" onclick="appAdminForm.action.value='click_modify';appAdminForm.attrName.value='nwRSCrole';appAdminForm.submit();">Modify </SPAN>

I was just told to use this RegEx:

Code:
<SPAN>.*

SBsteven


RE: RegEx for a child objects - v_selvam - 11-17-2009

If you use '<SPAN>.*</SPAN>' for string '<SPAN>Employer Service Rep</SPAN> ' this will return True

but for
Code:
<SPAN style="CURSOR: hand; COLOR: blue" onclick="appAdminForm.action.value='click_modify';appAdminForm.attrName.value='nwRSCrole';appAdminForm.submit();">Modify </SPAN> if you use <SPAN>.*,
this will return False