Function RegExpTest(patrn, strng)
Dim arr(), y
y = 0
   Dim regEx, Match, Matches   ' Create variable.
   Set regEx = New RegExp   ' Create a regular expression.
   regEx.Pattern = patrn   ' Set pattern.
   regEx.IgnoreCase = True   ' Set case insensitivity.
   regEx.Global = True   ' Set global applicability.
   Set Matches = regEx.Execute(strng)   ' Execute search.
   For Each Match in Matches   ' Iterate Matches collection.
  y = y +1
      For i=0 to Match.SubMatches.Count -1
   redim preserve arr(i+y)
   arr(y + i - 1) = Match.SubMatches(i)
  Next
   Next

   RegExpTest =  arr
End Function


dim res: res= RegExpTest( "NO\.\s+([0-9]+)\s", "REQUEST NO.  0588 EQUEST NO.
 0589 EQUEST NO.  0558 EQUEST NO.  058558 ")


for i=0 to ubound (res) - 1
  msgbox (res(i))
 next

On Mon, Jul 18, 2011 at 10:58 AM, MrB <[email protected]> wrote:

> I can get the SOAP msg and I am including a sample msg.
>
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/
> envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema";
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
> - <soapenv:Body>
>
>  .......
>
> END OF
> REQUEST NO.  0588
>
> </soapenv:Body>
> </soapenv:Envelope>
>
> I need to be able to get the request number from the XML so that I can
> pass the variable elsewhere in my testing.  Hope this makes sense.
>
> On Jul 17, 1:19 pm, Roman Zilber <[email protected]> wrote:
> > In which format and way you get SOAP? It should be some kind of XML, do
> you
> > have it stored in variable, or you have web utility to get SOAP?
> > ...
> >
> > Is something like that?
> >
> > http://mercuryquicktestprofessional.blogspot.com/2007/07/sending-soap...
> >
> > So where is a problem, you can't get SOAP? can't parse number from it?
> Don't
> > know how to organize the code (where to save the plan numbers etc)?
> > I really lost to understand the question, you can save all numbers in
> array
> > or in DataTable. like you do in any programming language.
> >
> >
> >
> >
> >
> >
> >
> > On Fri, Jul 15, 2011 at 10:56 AM, MrB <[email protected]> wrote:
> > > I thought my question was specific.  There is a plan number that is
> > > dynamic each time a plan is created.  I need to grab this plan number
> > > from the report and inject this number elsewhere.
> >
> > > On Jul 13, 8:05 pm, Roman Zilber <[email protected]> wrote:
> > > > What is a question? "How do I do this?"
> > > > Learn QTP and SOAP, once you have specific question, ask.
> >
> > > > On Wed, Jul 13, 2011 at 4:37 PM, MrB <[email protected]> wrote:
> > > > > Hi all.  First, let me say what we have.  We create plans.  Those
> > > > > plans have numbers associated with them.  Each time, the number is
> > > > > different.  I need to know how to grab this plan number from the
> SOAP
> > > > > report and then insert this plan number into another page we use in
> > > > > our application.  How do I do this?  I am a new user to QTP so my
> > > > > skills are rather limited.
> >
> > > > > Thanks in advance!
> >
> > > > > --
> > > > > 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
>

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

Reply via email to