Modeling the Regular Constraint with Integer Programming