Welcome to the ODK forum, @Ricardo1 ! We're glad you're here. When you get a chance, please introduce yourself on this forum thread. Thanks for adding a profile image; it helps build community!
That expression works for me when tested in an XLSForm.
regex_test.xlsx (8.7 KB)
+------+------+-------------+--------------------------+------------+
| type | name | label | constraint | appearance |
+------+------+-------------+--------------------------+------------+
| text | emis | EMIS Number | regex(.,'^[0-9]{9,12}$') | numbers |
+------+------+-------------+--------------------------+------------+