This topic describes the wildcard patterns supported by OceanBase Migration Service (OMS) for matching rules.
Background
Wildcard patterns are used in a way similar to regular expressions. The wildcards supported by OMS include "*", "?", "[]", and "[!]". Meanwhile, OMS allows you to specify a schema name by using a wildcard pattern, 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 object migration rules and object exclusion rules, a new table created in the source can be synchronized by OMS in real time if the table name matches a migration rule and does not match any exclusion rule.
Asterisk (*)
You can use an asterisk to match a string of characters in any length, or a null character. You can also use an asterisk to select all objects in a database or schema. 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. You can also use a question mark to select the objects in a database or schema that meet specified conditions. 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.
Notice
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.
Square brackets ([])
You can use a pair of square 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 the verification succeeds, click Preview Objects and view the objects on the Matching Result tab.
An exclamation point in square brackets ([!])
You can use this wildcard to match any non-null characters that are not included in the square 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 the verification succeeds, click Preview Objects and view the objects on the Matching Result tab.