›> ›> Check Multiple Values using Regex and Match

Check for Multiple Values with a Single Rule using Regex and Match


Real-Life Mapping Scenario

We are receiving an inbound x12 EDI 850 (Purchase Order) where we need to test the N104 value for various values. We have 2 options to check for these values.

  • 1. Create multiple instances of the same rule and add an conditional rule that checks for a unique value
  • 2. Create a single instance of the same rule and a single conditional rule that checks for ALL the unique values

In our example below, we will check for ALL the unique values in a single rule

Ruleset Rules Set-up

In our ruleset we set-up a Composite Rule and apply the Match Rule Condition.

EXTOL Business Integrator Ruleset Rules

Applying Rule Condition to Composite Rule

In the Match Condition we will apply Regex syntax to compare multiple values.

EXTOL Business Integrator Ruleset Match Regex Rule Condition

Comparing Regex Value Against Input Value

After the Match Condition is applied, we will test the N104_VN value against multiple values such as 7777, 195800, 103008, 7036, 101406 and etc.

EXTOL Business Integrator Ruleset Regex input values

By: on
load('http://www.extol.com/extolnews.rss'); $feed = array(); foreach ($rss->getElementsByTagName('item') as $node) { $item = array ( 'title' => $node->getElementsByTagName('title')->item(0)->nodeValue, 'desc' => $node->getElementsByTagName('description')->item(0)->nodeValue, 'link' => $node->getElementsByTagName('link')->item(0)->nodeValue, 'date' => $node->getElementsByTagName('pubDate')->item(0)->nodeValue, ); array_push($feed, $item); } $limit = 4; echo ' A free web counter provided by GoStats.