Back to articles list
- 2 minutes read

How to filter tables in the Vertabelo reverse engineering tool

Sometimes you don't want the reverse engineering tool to extract all of the tables in your database. For example, the database may contain technical tables which are logically are not part of the model. This is when the -regexp option comes in handy.

Use the -regexp option and the tool will extract all tables and views with names matching the regular expression. The tool prints the regular expression it uses so you can verify that your shell parsed the expression correctly. For this option to work, the regular expression has to be in the Java syntax. For those unfamiliar with Java syntax, below is a little guide.

-regexp option at work

Java regular expressions guide

Quantifiers

. Matches any character
^regex Finds regex that must match at the beginning of the line.
regex$ Finds regex that must match at the end of the line.
[abc] Set definition, can match the letter a or b or c.
[abc][vz] Set definition, can match a or b or c followed by either v or z.
[^abc]When a caret appears as the first character inside square brackets, it negates the pattern. This can match any character except a or b or c.
[a-d]Ranges: matches a letter between a and d.
X|ZFinds X or Z.
XZFinds X directly followed by Z.
\dA digit: [0-9]
\DA non-digit: [^0-9]

Negation

*Match 0 or more times
+Match 1 or more times
?Match 1 or 0 times
{n}Match exactly n times
{n,}Match at least n times
{n,m}Match at least n but no more than m times

Examples

^(?!regex).*Match strings not matching the regex
a.*Words starting with a
[abc].*Words starting with a, b or c
.*_priceWords ending with _price
a.*|.*aWords starting with a or ending with a
.*\d.*Words containing a digit
go to top