Tanjamuse:
You are using the SQL Query Tab. The "9" in that Custom Column table number has nothing whatsoever to do with anything else. It is a coincidence that the Regular Expression Tab regular expression that you used in the Full Text Query Tab was a "9".
See the attached picture of the ToolTips for my SQL Query Tab. The numbers on the left are the Custom Column table numbers. They are Calibre-Library specific. Your numbers will be different than mine, and even different among your own Libraries (unless they are copies of each other).
The SQL Query Tab can use regular expressions, but only as part of the SQL that you write. The "example SQL" button in that Tab has a lot of examples, including one with the REGEXP operator (I wrote just for MCS, by the way; it is not standard SQL that comes with Calibre).
Code:
/*Comments: An example that finds ISBNs within Tags: SELECT book FROM _mcs_tags_by_book WHERE tagname LIKE '%978%' OR tagname LIKE '%045%' OR tagname LIKE '%isbn%' OR tagname REGEXP '^[0-9][-]*[0-9][-]*[0-9][-]*[0-9][-]*[0-9][-]*[0-9][-]*[0-9][-]*[0-9][-]*[0-9][-]*[0-9]+$'*/
Again, the SQL Query Tab does not use any of the Regular Expression Tab's regular expressions. Those regular expressions are used only by the Intra/Inter Book Query Tab and the Full-Text Query Tab.
DaltonST