All Products
Search
Document Center

ApsaraDB for OceanBase:Wildcard patterns supported for matching rules

Last Updated:Jan 23, 2024

This topic describes the wildcard patterns supported by the data transmission service for configuring matching rules.

Background information

A wildcard pattern is similar to a regular expression. The data transmission service supports the following wildcard patterns: "*", "?","[]", and "[!]". The data transmission service supports wildcards for specifying schema names, for example, schema*.*. The matching rules to include or exclude migration objects are case-sensitive. A rule is hit only when the name of the source object exactly matches the rule, including the case.

After you configure the object migration and exclusion rules, a new table created at the source database can be synchronized by the data transmission service in real time if the table name matches the migration rule and does not match the exclusion rule.

Asterisk (*)

You can use an asterisk to match a string of characters in any length. It can also be an empty character. For example, if you set Object Migration Rule to <Schema>.*, all tables and views in the specified schema are displayed on the Matching Result tab in the right-side panel.

*

In the Object Exclusion Rule field, you can set the objects that do not need to be migrated, and then click Verify. After verification is passed, click Preview Objects and view the objects on the Matching Result tab.

排除

Question mark (?)

You can use a question mark to match a single character. To match more than one character, use multiple consecutive question marks. For example, if you set Object Migration Rule to <Schema>.t?, tables and views that conform to the format in the specified schema are displayed on the Matching Result tab in the right-side panel.

Important

You cannot use a question mark to match an empty character. In other words, the place held by the question mark must have a character.

?

In the Object Exclusion Rule field, you can set the objects that do not need to be migrated, and then click Verify. After verification is passed, click Preview Objects and view the objects on the Matching Result tab.

排除对象

Brackets ([])

You can use a pair of brackets to include any characters that must be matched, or use [start-end] to match a continuous range. For example, if you set Object Migration Rule to <Schema>.[]*, tables and views that conform to the format in the specified schema are displayed on the Matching Result tab in the right-side panel.

[]

In the Object Exclusion Rule field, you can set the objects that do not need to be migrated, and then click Verify. After verification is passed, click Preview Objects and view the objects on the Matching Result tab.

排除[]

An exclamation point enclosed with brackets ([!])

You can use this wildcard pattern to match any non-empty characters that are not enclosed in the brackets or use [!start-end] to indicate a continuous range. For example, if you set Object Migration Rule to <Schema>.[!]*, tables and views that conform to the format in the specified schema are displayed on the Matching Result tab in the right-side panel.

[!]

In the Object Exclusion Rule field, you can set the objects that do not need to be migrated, and then click Verify. After verification is passed, click Preview Objects and view the objects on the Matching Result tab.

排除[!]