← match_characters operator page · comparison/match_characters/sc_sc/matching_string
pandas ✅ · DuckDB ✅
match_characters(SC_1, SC_2) with SC_1 = "AX123" and SC_2 = "[A-Za-z]{2}[0-9]{3}": a string that matches a pattern of two letters and three digits.
Match characters: "match_characters returns true if op matches the regular expression regexp, false otherwise." The pattern is "an Extended Regular Expression as described in the POSIX standard", and the page warns that implementations "may behave in slightly different ways": each string here matches in full or has no match at all, so matching the whole string and searching inside it agree.
SC_r = true, a Boolean: AX123 is two letters followed by three digits.
SC_r := match_characters(SC_1, SC_2);
| SC_1 | SC_2 |
|---|---|
| AX123 | [A-Za-z]{2}[0-9]{3} |
{
"scalars": [
{"name": "SC_1", "type": "String"},
{"name": "SC_2", "type": "String"}
]
}
{
"scalars": [
{"name": "SC_r", "type": "Boolean", "value": true}
]
}