That property is to specify allowed characters. Surprisingly, it even allows alphabets, symbols, etc...
<EditText
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:inputType="number"
android:digits="0123abc"
android:ems="10"/>
This will limit the input to just 0, 1, 2, 3, a, b and c.
Is there a way to set a regex in my layout?
You're probably could but it is limited to EditTexts by using a custom attribute and implementing InputFilter. It is not just adding extra works but making everything far more complicated and I'm pretty sure this is not something that you want to hear.
This should allow only UPPERCASE LETTERS and NUMBERS
android:digits="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"