ARRAY{ matcher_expression }{min,max} matches a repeated sequence of elements that share the same pattern, applying the element pattern matcher_expression—enclosed in braces—until it no longer matches or reaches the maximum number of repetitions, and collects each match into an array.
Use the following expression to parse a comma-separated list of integers into an array:
ARRAY{ INT:n ','? }{1,5}:result
For example:
| Description | input (string) | result (array) |
|---|---|---|
Multiple elements |
|
|
Single element |
|
|
Several elements |
|
|
More than the maximum |
|
|
Stops at first non-matching element |
|
|
No match |
|
|
Whitespace |
|
|
Space instead of separator |
|
|
Missing element |
|
|
data record(input = "2,3,7"),record(input = "42"),record(input = "2,3,7,7,1"),record(input = "2,3,7,7,1,9"),record(input = "2,3,a,7"),record(input = "abc"),record(input = " "),record(input = "2 3,7,7,1"),record(input = "2,3,,7,1")| parse input, "ARRAY{ INT:n ','? }{1,5}:result"
ARRAY{ matcher_expression }( parameter = value, ... ){ min, max }:result
| parameter | type | Description |
|---|---|---|
|
| An IETF BCP 47 language tag enclosed in single or double quotes. Enables locale-specific parsing in the element matchers, such as localized month and day names. Default: English. |
|
| A character set name enclosed in single or double quotes (for example, |
The quantifier is required and has no default.
| parameter | type | Description |
|---|---|---|
|
| Minimum number of repetitions, as a non-negative integer. If fewer than |
|
| Maximum number of repetitions, greater than or equal to |
The data type of the extracted value is array. Each element keeps the data type of the matcher used inside the braces.
The following pattern checks whether the input is a slash-separated list of 3 to 5 integers. Because matchesPattern anchors to the whole input, an input with more than the maximum number of elements does not match:
ARRAY{ INT*:n '/'? }{3,5}
The * quantifier on INT makes each slot in the body optional: when no integer precedes the separator, the slot still counts as an element (with a null value). Without *, every element must contain at least one integer, so consecutive separators like 1//3 or a leading separator like /1/2/3 stop the count and the match fails.
| Description | input (string) | result (boolean) |
|---|---|---|
Within range |
|
|
Too few elements |
|
|
More than the maximum |
|
|
Consecutive separators |
|
|
Leading separator |
|
|
data record(input = "1/2/3"),record(input = "1/2"),record(input = "1/2/3/4/5/6/7"),record(input = "1//3"),record(input = "/1/2/3")| fieldsAdd result = matchesPattern(input, "ARRAY{ INT*:n '/'? }{3,5}")
Given the following input:
tags=alpha,beta,gamma
Use the following pattern to extract the tags into an array:
'tags=' ARRAY{ WORD:tag ','? }{1,20}:tags
tags (array) |
|---|
|
data record(input = "tags=alpha,beta,gamma")| parse input, "'tags=' ARRAY{ WORD:tag ','? }{1,20}:tags"
Given the following input with German month names:
März;Juli;Dezember
Use the following pattern to parse the months into an array of timestamps. The locale configuration makes the inner TIMESTAMP matcher recognize German month names:
ARRAY{ TIMESTAMP('MMMM'):month ';'? }(locale='de'){1,20}:months
months (array) |
|---|
|
data record(input = "März;Juli;Dezember")| parse input, """ARRAY{ TIMESTAMP('MMMM'):month ';'? }(locale='de'){1,20}:months"""
Given the following input:
cpu=80;mem=45;disk=90
When the element pattern captures more than one field, each repetition becomes a record. Use the following pattern to extract every metric=value pair:
ARRAY{ WORD:metric '=' INT:value ';'? }{1,20}:samples
samples (array) |
|---|
|
data record(input = "cpu=80;mem=45;disk=90")| parse input, "ARRAY{ WORD:metric '=' INT:value ';'? }{1,20}:samples"
Given the following tablespace report:
input (string) |
|---|
|
Use the following pattern to collect the Used % value from every line into an array. DATA skips the rest of each line, and the lookahead >> (EOL|EOS) anchors the value to the end of the line, so only the last column is captured instead of the earlier numbers:
ARRAY{ DATA ([0-9]{1,2} '.' [0-9]{2} >> (EOL|EOS)):i }{1,}:result
result (array) |
|---|
|
data record(content = """Status Name Type Extent Man Initial Extent Size (M) Used (MB) Used %--------- -------------- ---------- --------------- ------------------ ------------ ------------ --------------ONLINE SAMPLE_INDEX_X GROUP_ONE EXT_A 65536 908,304.000 905,890.125 99.73ONLINE SAMPLE_INDEX_X GROUP_ONE EXT_A 65536 908,304.000 905,890.125 99.72ONLINE SAMPLE_INDEX_X GROUP_ONE EXT_A 65536 908,304.000 905,890.125 99.71ONLINE SAMPLE_INDEX_X GROUP_ONE EXT_A 65536 908,304.000 905,890.125 99.79""")| parse content, "ARRAY{ DATA ([0-9]{1,2} '.' [0-9]{2} >> (EOL|EOS)):i }{1,}:result"
Given the following nginx access log line, where $upstream_status records the result of each upstream attempt. Nginx separates these codes with commas (retries within an upstream group) and colons (between groups after an internal redirect), so the list mixes both:
10.0.3.14 - - [25/Jun/2026:10:42:13 +0000] "GET /api/orders HTTP/1.1" 200 1543 upstream_status: 502, 502 : 200
Use the following pattern to collect every status code into an array. The [,: ]* character class consumes any run of commas, colons, or spaces between elements:
LD 'upstream_status: ' ARRAY{ INT:code [,: ]* }{1,20}:upstream_status
upstream_status (array) |
|---|
|
data record(input = """10.0.3.14 - - [25/Jun/2026:10:42:13 +0000] "GET /api/orders HTTP/1.1" 200 1543 upstream_status: 502, 502 : 200""")| parse input, "LD 'upstream_status: ' ARRAY{ INT:code [,: ]* }{1,20}:upstream_status"