Using Extract Variable Policy, can we extract the substring of a string?

I have implemented with the JS, want to know if we can implement using the policies

Solved Solved
1 4 979
2 ACCEPTED SOLUTIONS

@Amar N ,

Yes, It's possible. It does support substring extraction from a string. For more details reger policy documentation here.

For Example, below pattern will extract substring from queryparam. If queryparam value is "DBN001" then code extracted will be 001.

   <QueryParam name="code">
      <Pattern ignoreCase="true">DBN{dbncode}</Pattern>
   </QueryParam>

Keep us posted if you have any queries.

View solution in original post

Yes it is possible only when the sub string is varying and the main string except supstring is constant.

View solution in original post

4 REPLIES 4

@Amar N ,

Yes, It's possible. It does support substring extraction from a string. For more details reger policy documentation here.

For Example, below pattern will extract substring from queryparam. If queryparam value is "DBN001" then code extracted will be 001.

   <QueryParam name="code">
      <Pattern ignoreCase="true">DBN{dbncode}</Pattern>
   </QueryParam>

Keep us posted if you have any queries.

Hi ,

Can you give an example for raise fault policy, how we can substring error fault string to extract specific information.

Yes it is possible only when the sub string is varying and the main string except supstring is constant.

So, if the entire string is varying and we would only like to extract for example the last 5 digits of a 8 digit queryparam, it is not possible?