Documentation

    regexp_split_to_array

    Split text at each match of a regular expression and return the parts as a list. An optional argument sets regex options.

    Also available as str_split_regex, string_split_regex.

    Try an expression

    In Formula, enter the expression and set Output type to VARCHAR.

    Expression

    regexp_split_to_array('hello world; 42', ';? ')

    Result

    '[hello, world, 42]'

    The expression returns VARCHAR[]. Formula stores it as VARCHAR in this example. To use your own data, replace the example values with column names. Keep format strings and other options as written.

    Arguments and types

    regexp_split_to_array(string, regex, options)
    string
    Text
    regex
    Text
    options
    Text
    Supported signatures (2)
    regexp_split_to_array(string: VARCHAR, regex: VARCHAR) → VARCHAR[]
    regexp_split_to_array(string: VARCHAR, regex: VARCHAR, options: VARCHAR) → VARCHAR[]

    The result type can depend on the input types. See DuckDB for the full argument rules.

    Things to know

    If the first argument is missing, the result is NULL.

    Browse patternsDuckDB documentation

    Function metadata from DuckDB, used under the MIT license.