mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-27 00:33:48 -05:00
The new function returns an array of strings captured by capturing groups in a supplied regular expression. For e.g., the following expression: regexp_matches('qgis=>rocks','(.*)=>(.*)') will return the following array: 'qgis', 'rocks'.
13 lines
828 B
Plaintext
13 lines
828 B
Plaintext
{
|
|
"name": "regexp_matches",
|
|
"type": "function",
|
|
"description": "Returns an array of all strings captured by capturing groups, in the order the groups themselves appear in the supplied regular expression against a string.",
|
|
"arguments": [
|
|
{"arg":"string", "description":"the string to capture groups from against the regular expression"},
|
|
{"arg":"regex","description":"the regular expression used to capture groups"},
|
|
{"arg":"empty_value","optional":true,"default":"''","description":"the optional string to use as replacement for empty (zero length) matches"}],
|
|
"examples": [ { "expression":"regexp_matches('qgis=>rocks','(.*)=>(.*)')", "returns":"array: 'qgis', 'rocks'"},
|
|
{ "expression":"regexp_matches('key=>','(.*)=>(.*)','empty value')", "returns":"array: 'key', 'empty value'"}
|
|
]
|
|
}
|