All Products
Search
Document Center

Tablestore:ValueTransferRule

Last Updated:Aug 06, 2024

Converts a string to the String, Integer, or Double type after the string is matched by using a regular expression.

Data structure

message ValueTransferRule {
    required string regex = 1;
    optional VariantType cast_type = 2;
}

Parameter

Type

Required

Description

regex

string

Yes

The regular expression that is used to match strings. The regular expression must meet the following requirements:

  • The regular expression can be up to 256 bytes in length.

  • The syntax of the regular expression in Perl is supported.

  • The regular expression can be 1 byte in length.

  • Regular expression matching in Chinese is not supported.

  • The full matching mode and partial matching mode of the regular expression are supported.

    In the partial matching mode, the subfield values to match are enclosed in a pair of parentheses () in a regular expression.

    If the full matching mode is used, the first matching result is returned. If the partial matching mode is used, the first submatch result is returned. For example, if the column value is 1aaa51bbb5 and the regular expression is 1[a-z]+5, the return value is 1aaa5. If the regular expression is 1([a-z]+)5, the return value is aaa.

cast_type

VariantType

No

Converts a string to the String, Integer, or Double type for subsequent relational operations.