This file is part of DecimalsRangeRegexpGenerator.

DecimalsRangeRegexpGenerator is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

DecimalsRangeRegexpGenerator is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with DecimalsRangeRegexpGenerator. If not, see

©Copyright 2022 Laurent Lyaudet


Handle min, max and step to produce a regular expression for ranges of decimal numbers.

Several integers range regular expression generators can be found on GitHub, but they do not handle decimal numbers. (Decimal numbers are the subset of the rational numbers that can be written as n/10^k where n and k are integers.) They can handle min and max parameters, but they do not handle step parameter.

The goal of this dev tool is to have an easy path to avoid most use cases of HTML’s:

<input type="number" min="@some_decimal1@" max="@some_decimal2@" step="@some_decimal3@">

by using

<input type="text" inputmode="numeric" pattern="@some_regexp@">


For a few reasons to replace input number with input text and a pattern, you may read the following blog articles or webpages:

Current features

So far, you can customize your regular expression with the following optional parameters:

Moreover, you can change the number of digits (your base) and the unicode characters you use for:

With a number of digits different of ten, you are not dealing with decimal numbers anymore. You look at numbers that can be written as n/b^k where n and k are integers and b is your base (the number of digits you specified). Try the digits “0🐛” for “buginary” encoding ;).

Spacing is supported with:

There is also one parameter:

app.html is hosted there on my website: Since it is only static HTML and JS, it should handle many users :). Otherwise, you can just save the file on your computer, and open it in your web-browser to use it.

If you are happy with GNU AGPL, I welcome contributions to this project for the following things to be done:

Please, email me, if you are interested.