ValueTransferRule converts a string to the String, Integer, or Double type after using a regular expression to match the string.

Data structure

message ValueTransferRule {
    required string regex = 1;
    optional VariantType cast_type = 2;
}
Parameter Type Required Description
regex string Yes A regular expression that is used to match strings. The regular expression must meet the following conditions:
  • Contains a maximum of 256 bytes in length.
  • Supports the syntax of regular expressions in Perl.
  • Supports the single-byte regular expressions.
  • Supports only the expression matching in languages excluding Chinese.
  • Supports full matching and partial matching of regular expressions.

    In partial matching mode, regular expressions are separated by a pair of parentheses ().

    If the full matching mode is used, the first matching result is returned. If particle matching mode is used the first submatch 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 Yes Converts a string to the String, Integer, or Double type for subsequent relational operations.