few notes:
1. end of string is `\z` and not `\Z`
2. you test for integer but allow `.`? this looks strange.
3. I think it is better to use ruby builtins there. 
for integer it can be
```
  begin
    Integer(votes)
  rescue ArgumentError
    Popup.Message(_"expected_votes must have an integer number")
    return false
  end
```
and similar to float using Float.
4. if you really want only integers you can specify valid characters for widget this way:
```
UI.ChangeWidget(:expected_votes, :ValidChars, "0123456789" );
```