http://www.fileformat.info/tool/regex.htm
Regular ExpressionOriginal Expressionvalue="{0,1}([^"> ]*)as a Java
string"value=\"{0,1}([^\">
]*)"ReplacementgroupCount()1TestTarget Stringmatches()replaceFirst()
replaceAll()lookingAt()find()group(0)group(1)1<OPTION value=""></OPTION>
<OPTION value=DENYALL>Deny All</OPTION><OPTION value=DENYENTRY>Deny
Entry</OPTION><OPTION value=DENYEXIT>Deny Exit</OPTION><OPTION
value=UNRESTRICT selected>Unrestricted</OPTION>No<OPTION "></OPTION> <OPTION
value=DENYALL>Deny All</OPTION><OPTION value=DENYENTRY>Deny
Entry</OPTION><OPTION value=DENYEXIT>Deny Exit</OPTION><OPTION
value=UNRESTRICT selected>Unrestricted</OPTION><OPTION "></OPTION> <OPTION
>Deny All</OPTION><OPTION >Deny Entry</OPTION><OPTION >Deny
Exit</OPTION><OPTION selected>Unrestricted</OPTION>NoYesvalue="next find()
Yesvalue=DENYALLDENYALLnext find()Yesvalue=DENYENTRYDENYENTRYnext find()Yes
value=DENYEXITDENYEXITnext find()Yesvalue=UNRESTRICTUNRESTRICT
On Tue, May 3, 2011 at 8:42 AM, Revanth <[email protected]> wrote:
> Hi Karthikeyan,
>
> The same can be done by using XMLUtil Object in QTP by it as xml file and
> loading into XMLUtil Object.
>
> However if you need only value attributes you can use string functions as
> like instr, mid etc., which helps in finding only values
>
> Thanks,
> Revanth
>
>
> On 3 May 2011 13:52, Karthikeyan <[email protected]>wrote:
>
>> Hi all,
>>
>> I have a requirement as below.
>>
>> I get a dynamic string as follows:
>> <OPTION value=""></OPTION> <OPTION value=DENYALL>Deny All</OPTION><OPTION
>> value=DENYENTRY>Deny Entry</OPTION><OPTION value=DENYEXIT>Deny
>> Exit</OPTION><OPTION value=UNRESTRICT selected>Unrestricted</OPTION>
>>
>> My requirement is: to read all the "value" attributes in the above string.
>> Is there a simple way to do that. Is it possible to save this string as an
>> XML and read the attributes for each "OPTION" node?
>>
>> Please suggest/guide me few solutions.
>>
>> Regards,
>> Karthikeyan
>>
>> --
>> You received this message because you are subscribed to the Google
>> "QTP - HP Quick Test Professional - Automated Software Testing"
>> group.
>> To post to this group, send email to [email protected]
>> To unsubscribe from this group, send email to
>> [email protected]
>> For more options, visit this group at
>> http://groups.google.com/group/MercuryQTP?hl=en
>
>
> --
> You received this message because you are subscribed to the Google
> "QTP - HP Quick Test Professional - Automated Software Testing"
> group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/MercuryQTP?hl=en
>
--
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en