RegularExpressionProtection Policy Payload Example

Hi,

Can someone please give me the exact payload examples which will satisfied the pattern define in the RegularExpressionProtection policy here

https://docs.apigee.com/api-platform/reference/policies/regular-expression-protection#samples


Please pass only valid working example payload, no assumption please

Required header

Content-Type:application/json

<RegularExpressionProtection name="JsonPathRegExProtection">
  <DisplayName>Regular Expression Protection 1</DisplayName>
  <Source>request</Source>
  <JSONPayload escapeSlashCharacter="true">
    <JSONPath>
      <Expression>$.</Expression>
      <Pattern><\s*script\b[^>]*>[^<]+<\s*\/\s*script\s*></Pattern>
      <Pattern>n\s*\\\\\s*slash</Pattern>
      <Pattern>n\s*\/\s*slash</Pattern>
      <Pattern>n\s*\\"\s*quotes</Pattern>
      <Pattern>n\s*\\b\s*space</Pattern>
      <Pattern>n\s*\\f\s*forwardfeed</Pattern>
      <Pattern>n\s*\\n\s*newline</Pattern>
      <Pattern>n\s*\\r\s*carria</Pattern>
      <Pattern>n\s*\\t\s*tab</Pattern>
      <Pattern>n\s*\\uFFFF\s*hex</Pattern>
    </JSONPath>
  </JSONPayload>
</RegularExpressionProtection>

0 2 222
2 REPLIES 2

Sorry, can you clarify?

I think you're asking, what string would match this regular expression?, is that right?

Are you asking about a specific regex cited in the documentation page?

or are you asking about the regex expressions you specified in your example policy?

Hi Dino,

Yes, I wanted to know the string in payload which matches the expression listed on the policy above .

what string would match this regular expression?, is that right? (Yes)