Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expanding class digit range #59

Open
zdilto opened this issue Sep 17, 2021 · 2 comments
Open

expanding class digit range #59

zdilto opened this issue Sep 17, 2021 · 2 comments

Comments

@zdilto
Copy link

zdilto commented Sep 17, 2021

range like [0-80] will only match 1 digit at a time:

exrex "[0-80]"
0
1
2
3
4
5
6
7
8
0

i think is a good feature if exrex can count the whole range and from 0 to 80:
0
1
2
..
23
..
65
..
80

it will facilate regex pattern considerably like in generating the following local ip address range: 192.168.0.0-192.168.255.255
for generating this ips one need to write a complex regex:

"^192\.168\.(\d|[1-9]\d|1\d\d|2([0-4]\d|5[0-5]))\.(\d|[1-9]\d|1\d\d|2([0-4]\d|5[0-5]))$"

but if supported we will only write:

"^192\.168\.[0-255]\.[0-255]$"

for making things easier we can write [n--m] or [n..m] [0--100] or [0..100] avoiding collision with regex class handling

@rautamiekka
Copy link

Yep, that's the RegEx standard, I know from having tried this with other RegEx Engines. Couldn't possibly had been so hard to make the ranges arbitrary instead of single integers.

@sebix
Copy link
Contributor

sebix commented Sep 18, 2021

Why do you want to deviate from the regex standard, breaking compatibility, leading to unexpected behaviour?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants