Hi Neal,
The 2nd parenthesized group in your regex might
specify too many characters. I can't try this now
but here's a suggestion. Limit it
to the regex expression
that represents "not ampersand and not double quote".
Placing a '+' after it requires one or more matching
characters.
Like :
Reg Expr: (SessionID=)([^&"]+)([&"])
Since you gave the variable the name 'SessionID', then
refer to it like :
${SessionID}
in the 2nd page POST.
Lee Peterson
SAS Institute Inc.
SAS ... The Power to Know
> -----Original Message-----
> From: Neal O'Connell [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, March 23, 2004 4:20 PM
> To: [EMAIL PROTECTED]
> Subject: Newb needs regular expression help
>
>
> I'm having a little trouble with regular expressions. Here
> is the basic
> flow of the web application when used in a browser
>
> - User requests page
> - Server returns a frameset (the requested page is in the
> frameset). A link
> on the frameset page includes a query parameter that has a
> unique identifier
> for session tracking (SessionID is the variable name)
>
> General layout of my script is (using v1.9.1)
>
> - Thread Group
> - First Page (GET) (returns a frameset)
> - Regular Expression Extractor to get SessionID
> - Second page (POST) (passes SessionID as a variable)
>
> My regular expression has the following properties
>
> Ref Name: SessionID
> Reg Expr: (SessionID=)(.*)([&"])
> Template: $2$
> Match No: 1
> Default: 0
>
> I'm obviously missing something, because when I monitor the
> server I can see
> that the SessionID that gets POSTed with the second page has
> a default value
> of 0 rather than what should have been parsed out of the extractor.
>
> From my (albeit minimal) understanding of regular
> expressions, I expect that
> this will look for text in the response that fits the pattern:
>
> Starts with "SessionID="
> Ends with " or &
> Can have 0 or more characters in between.
>
> And the parantheses break the expression into three groups:
> 1 - "SessionID" string literal
> 2 - SessionID value
> 3 - " or & character
>
> So setting the Template to $2$ means put the second group
> into the variable.
>
> A snippet from the frameset might help:
>
> <frame name="visibleFrame"
> src="mainpage.htm?InstanceID=1193356129&SessionID=wiQHYYlHzYEokrCo">
>
>
> Can somebody please help me out? Maybe I just need to find a quality
> regular expressions tutorial...
>
>
> Thanks!
>
> Neal O'Connell | Developer
> Phone: 859.245.3841 | Fax: 715.287.4499
> MI-Assistant - A Division of Fiserv, FSC
> 26550 W. Mondovi Street | Eleva, WI 54738
> http://www.mi-assistant.com
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]