QTP Forums

Full Version: RegEx for a child objects
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I need to write a regular expression for this:

<SPAN>Employer Service Rep</SPAN>

This is what I am using, is this correct?

<SPAN>.*</SPAN>

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

Here is what I do want to filter on:

<SPAN>Employer Service Rep</SPAN>

Here is what I DO NOT want:

<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:

<SPAN>.*

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

but for <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
Reference URL's