Re: PCRE for URI having QueryParameters

‏2013-02-28T08:58:34Z

This is the accepted answer.
This is the accepted answer.

Hi,

> (Note: Allowed token names are "token1" and "token2". Value of tokens can be anything.)
>
you need to be more specific on "anything".
I assume that you do not mean to allow for eg. control characters ...

Below regular expression is for "anything" as "integer numbers", the backslash escapes are needed by the shell:

> (Note: Allowed token names are "token1" and "token2". Value of tokens can be anything.)
>
you need to be more specific on "anything".
I assume that you do not mean to allow for eg. control characters ...

Re: PCRE for URI having QueryParameters

> (Note: Allowed token names are "token1" and "token2". Value of tokens can be anything.)
>
you need to be more specific on "anything".
I assume that you do not mean to allow for eg. control characters ...

Perhaps a better idea for you is to use convert-http action in order to convert the query into XML.
Then you can make use of the full power of Schema validation and validate the XML ...
<pre class="java dw" data-editor-lang="java" data-pbcklang="java" dir="ltr">$ curl "http://dp3-l3:2227/abc?token1=12&token2=13" -s | tidy -qi -xml
<?xml version="1.0" encoding="utf-8"?>
<request>
<url>/abc?token1=12&amp;token2=13</url>
<base-url>/abc</base-url>
<args src="url">
<arg name="token1">12</arg>
<arg name="token2">13</arg>
</args>
</request>
$
</pre>

Re: PCRE for URI having QueryParameters

Perhaps a better idea for you is to use convert-http action in order to convert the query into XML.
Then you can make use of the full power of Schema validation and validate the XML ...
<pre class="java dw" data-editor-lang="java" data-pbcklang="java" dir="ltr">$ curl "http://dp3-l3:2227/abc?token1=12&token2=13" -s | tidy -qi -xml
<?xml version="1.0" encoding="utf-8"?>
<request>
<url>/abc?token1=12&amp;token2=13</url>
<base-url>/abc</base-url>
<args src="url">
<arg name="token1">12</arg>
<arg name="token2">13</arg>
</args>
</request>
$
</pre>