convert to integer and fix regexp