Skip to content

Commit a7033e9

Browse files
Copilotnielstron
andcommitted
Update README with correct regex output examples
Co-authored-by: nielstron <20638630+nielstron@users.noreply.github.com>
1 parent f51a77c commit a7033e9

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ If you pass only one bound, the other is unbounded:
3939

4040
```python
4141
regex3 = range_regex(minimum=5)
42-
# (?:[5-9]|[1-9]\d(?:\d)*)
42+
# (?:[5-9]|[1-9]\d+)
4343

4444
regex4 = range_regex(maximum=89)
45-
# (?:\-[1-9](?:\d)*|\d|[2-7]\d|1\d|8\d)
45+
# (?:\-[1-9]\d*|\d|[2-7]\d|1\d|8\d)
4646

4747
regex5 = range_regex()
48-
# (?:\-[1-9](?:\d)*|[1-9](?:\d)*|0)
48+
# (?:\-[1-9]\d*|[1-9]\d*|0)
4949
```
5050

5151
### Decimal ranges (`float_range_regex`)
@@ -56,16 +56,16 @@ regex5 = range_regex()
5656
from range_ex import float_range_regex
5757

5858
regex6 = float_range_regex(0.5, 1.5, strict=True)
59-
# (?:(?:0)?\.[5-9](?:\d)*|1\.[0-5](?:\d)*)
59+
# (?:0?\.(?:[5-9]|[5-9]\d*)|1\.(?:(?:[0-5]|[0-4]\d*|50+))?|1\.)
6060

6161
regex7 = float_range_regex(0.5, 1.5, strict=False)
62-
# (?:1|(?:0)?\.[5-9](?:\d)*|1\.[0-5](?:\d)*)
62+
# (?:0?\.(?:[5-9]|[5-9]\d*)|1\.(?:(?:[0-5]|[0-4]\d*|50+))?|1\.?)
6363

6464
regex8 = float_range_regex(maximum="1.5", strict=True)
65-
# (?:\-[1-9](?:\d)*\.\d(?:\d)*|(?:0)?\.\d(?:\d)*|1\.[0-5](?:\d)*)
65+
# (?:\-(?:(?:0|[1-9]\d*)\.\d+|(?:0|[1-9]\d*)\.|\.\d+)|0?\.\d+|0\.\d*|1\.(?:(?:[0-5]|[0-4]\d*|50+))?|(?:\-[1-9]\d*|[0-1])\.|\-0\.|\-0\.0+|\-\.0+)
6666

6767
regex9 = float_range_regex(strict=True)
68-
# (?:(?:\-)?(?:0|[1-9](?:\d)*)\.\d(?:\d)*|(?:\-)?(?:0|[1-9](?:\d)*)\.|(?:\-)?\.\d(?:\d)*)
68+
# (?:\-?(?:0|[1-9]\d*)\.\d+|\-?(?:0|[1-9]\d*)\.|\-?\.\d+|(?:\-[1-9]\d*|[1-9]\d*|0)\.|\-0\.|\-0\.0+|\-\.0+)
6969
```
7070

7171
### Rendering options

0 commit comments

Comments
 (0)