makeDecimalInterval

fun makeDecimalInterval(min: Int, max: Int, digits: Int): Automaton

Returns a new automaton that accepts strings representing decimal (base 10) non-negative integers in the given interval.

Parameters

min

minimal value of interval

max

maximal value of interval (both end points are included in the interval)

digits

if > 0, use fixed number of digits (strings must be prefixed by 0's to obtain the right length) - otherwise, the number of digits is not fixed (any number of leading 0s is accepted)

Throws

if min > max or if numbers in the interval cannot be expressed with the given fixed number of digits