On 25/05/14 08:15, Paul Miller wrote:
Using the following regex in the website I get my desired outcome:

.*:([0-9]{4,5})[:;]

I am sure that this will not be the best way but certainly it works in the website just fine.

however when I use it an SIPp xml file I never get the same match as the website suggest

example for input sample TEST2
the match is SIPp is
SIP/2.0/UDP 192.168.0.65:5060 <http://192.168.0.65:5060>;

I am using this in the SIPp xml file

  <recv request="REGISTER" crlf="true">
    <action>
<ereg regexp=".*:([0-9]{4,5})[:;]" search_in="hdr" header="Via:" assign_to="vPort" />
    </action>
  </recv>



In SIPp, the first assign_to variable contains the whole match, the second contains the first subexpression (i.e. the bit in parentheses), the third contains the second subexpression, etc.

So:

<ereg regexp=".*:([0-9]{4,5})[:;]" search_in="hdr" header="Via:" assign_to="dummy,vPort" />
<Reference variables="dummy" />

will do what you want. (Note that you assign the full match to a dummy variable, then have to reference it, as it's otherwise unused.)

Rob
------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Sipp-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sipp-users

Reply via email to