← match_characters operator page · comparison/match_characters/ds_sc/manual_ex_1
pandas ✅ · DuckDB ✅
match_characters(DS_1, "[A-Za-z]{2}[0-9]{3}"): the string measure of DS_1 against a pattern.
Match characters, Example 1, output verbatim: "match_characters returns true if op matches the regular expression regexp, false otherwise."
bool_var is true for G (AX123) and false for R (AX2J5).
DS_r:=match_characters(DS_1, "[A-Za-z]{2}[0-9]{3}");
| Id_1 | Id_2 | Id_3 | Id_4 | Me_1 |
|---|---|---|---|---|
| G | Total | Percentage | Total | AX123 |
| R | Total | Percentage | Total | AX2J5 |
{
"datasets": [
{
"name": "DS_1",
"DataStructure": [
{"name": "Id_1", "type": "String", "role": "Identifier", "nullable": false},
{"name": "Id_2", "type": "String", "role": "Identifier", "nullable": false},
{"name": "Id_3", "type": "String", "role": "Identifier", "nullable": false},
{"name": "Id_4", "type": "String", "role": "Identifier", "nullable": false},
{"name": "Me_1", "type": "String", "role": "Measure", "nullable": true}
]
}
]
}
| Id_1 | Id_2 | Id_3 | Id_4 | bool_var |
|---|---|---|---|---|
| G | Total | Percentage | Total | true |
| R | Total | Percentage | Total | false |
{
"datasets": [
{
"name": "DS_r",
"DataStructure": [
{"name": "Id_1", "type": "String", "role": "Identifier"},
{"name": "Id_2", "type": "String", "role": "Identifier"},
{"name": "Id_3", "type": "String", "role": "Identifier"},
{"name": "Id_4", "type": "String", "role": "Identifier"},
{"name": "bool_var", "type": "Boolean", "role": "Measure"}
]
}
]
}