Array Regex Documentation
Version: 1.0.4
Retrieved: 2025-10-09 15:15:12
Array Regex
This Module uses a regular expression to filter out items in arrays on message properties. It has two modes of operation, one for filtering out items that matches the regular expression and one for filtering out items that don't. The message is then sent and the property is set to the array of remaining items.
This module is designed to be located in the middle of a flow.
More information about regular expressions can be found here
Settings
| Name | Requirements | Purpose | Default |
|---|---|---|---|
| Source Property | String with length 1-64 | Path to message property with the array | data |
| Regular Expression | String with length 1-64 | Regular expression to match array items against | .* |
| Match Regular Expression | bool | If true regex matches will go through, else items that do not match the regex will go through | true |
| Value Property | String with length 0-64 | If the array contains an object, specify which property on that object the Regular Expression will match with. If left empty, all array items will be matched directly with the Regular Expression. Required if the input array in Source Property is an array of objects | |
| Target Property | String with length 0-64 | The property to write the result into. If left empty, Source Property will be used and the property value in the incoming message will be overwritten |
Input
Incoming messages are required to have a array property at the path specified by Source Property. This property can be an array of strings or an array of objects with a string property to match the Regular Expression with.
Output
The output is the incoming message with the Source Property changed according to the Regular Expression match on the array items or with the Source Property unchanged but instead a new property Target Property with the matched array.
- Array items that match the Regular Expression when Match Regular Expression is set to true, is kept in the array property on the message sent to the next module.
- Array items that does not match Regular Expression when Match Regular Expression is set to false, is kept in the array property on the message sent to the next module.
- All other array items are filtered out and not included in the array property on the message sent to the next module(s).
- If the Source Property is not found a warning is set on the module and not message is sent to the next module(s). This happens also if it is not an array of strings or array of objects.
Examples
Example 1 - Using Match Regular Expression
# Settings:
Source Property = data
Regular Expression = ^Sensor[1-2]
Match Regular Expression = true
Value Property = name
Target Property =
# Incoming message:
{
data: [
{
name: "Sensor1",
value: 2
},
{
name: "Sensor2",
value: 4
},
{
name: "Sensor3",
value: 5
}
]
}
# Outgoing message:
{
data: [
{
name: "Sensor1",
value: 2
},
{
name: "Sensor2",
value: 4
}
]
}
Example 2 - Using Does Not Match Regular Expression
# Settings:
Source Property = data
Regular Expression = ^Sensor[1-2]
Match Regular Expression = false
Value Property = name
Target Property =
# Incoming message:
{
data: [
{
name: "Sensor1",
value: 2
},
{
name: "Sensor2",
value: 4
},
{
name: "Sensor3",
value: 5
}
]
}
# Outgoing message:
{
data: [
{
name: "Sensor3",
value: 5
}
]
}
Example 3 - Using empty Value Property
# Settings:
Source Property = data
Regular Expression = ^Sensor[1-2]
Match Regular Expression = true
Value Property =
Target Property =
# Incoming message:
{
data: [
"Sensor1",
"Sensor2",
"Sensor3"
]
}
# Outgoing message:
{
data: [
"Sensor1",
"Sensor2"
]
}
Example 4 - Using Target Property
# Settings:
Source Property = data
Regular Expression = ^Sensor[1-2]
Match Regular Expression = true
Value Property =
Target Property = filtered
# Incoming message:
{
data: [
"Sensor1",
"Sensor2",
"Sensor3"
]
}
# Outgoing message:
{
data: [
"Sensor1",
"Sensor2",
"Sensor3"
],
filtered: [
"Sensor1",
"Sensor2"
]
}
Search Documentation
Analytics Modules