Which is the best situation to use JavaRegex in the flow conditions.

We can use both JavaRegex and '=' sign to compare strings in condition folow. Which is the best situation to use JavaRegex in the flow conditions.

Solved Solved
0 1 243
1 ACCEPTED SOLUTION

@Amar N ,

  • It's simple, "=" operator is used for comparing string to string. like 'api' = 'api'

Below condition will match only if pathsuffix is "/cat" ,

<Condition>(proxy.pathsuffix = "/cat")</Condition>
  • JavaRegex is used for pattern matching like,
<Condition>(proxy.pathsuffix JavaRegex "/ca?t")</Condition>

GET http://artomatic-test.apigee.net/matchtest/cat - TRUE

GET http://artomatic-test.apigee.net/matchtest/ct - TRUE

Find more about same here.

View solution in original post

1 REPLY 1

@Amar N ,

  • It's simple, "=" operator is used for comparing string to string. like 'api' = 'api'

Below condition will match only if pathsuffix is "/cat" ,

<Condition>(proxy.pathsuffix = "/cat")</Condition>
  • JavaRegex is used for pattern matching like,
<Condition>(proxy.pathsuffix JavaRegex "/ca?t")</Condition>

GET http://artomatic-test.apigee.net/matchtest/cat - TRUE

GET http://artomatic-test.apigee.net/matchtest/ct - TRUE

Find more about same here.