REGEXP_EXTRACT_NTH

    String functions

    Syntax

    REGEXP_EXTRACT_NTH( string, pattern, match_index )
    

    Description

    Returns a substring string that matches the regular expression pattern pattern starting from the specified index.

    Argument types:

    • stringString
    • patternString
    • match_indexNumber (whole)

    Return type: String

    Note

    Only constant values are accepted for arguments (pattern).

    Note

    See the documentation of the data source to clarify the regular expression syntax.

    Use the ClickHouse syntax to create regular expressions in materialized datasets.

    Examples

    REGEXP_EXTRACT_NTH("RU 912 EN 873", "[A-Z]+\s+(\d+)", 2) = "873"
    

    Data source support

    Materialized Dataset, ClickHouse 1.1, MySQL 8.0.12, PostgreSQL 9.3.