REGEX_MATCH_POSITION
Matches the regular expression on the input string, and returns the index of the first match.
Syntax
Arguments
Name | Type | Description |
---|---|---|
pattern | string | Pattern to search for |
value | string | |
startPosition | numeric |
Returns
bigint
Examples
pattern | value | startPosition | Output |
---|---|---|---|
',' | '1,2,3' | 0 | 1 |
'2,\d' | '1,2,3' | 2 | 2 |
'2,\d' | '1,2,3' | 3 | null |
',' | '1,2,3' | -1 | null |
',' | '1,2,3' | -2 | 3 |
Transformation job example
SQL
Query result
pattern | value | startPosition | Output |
---|---|---|---|
',' | '1,2,3' | 0 | 1 |
Last updated