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

IP regex not working (with non capturing groups imbricated and negative lookahead) #31

Open
David-Lannion opened this issue Sep 12, 2023 · 1 comment

Comments

@David-Lannion
Copy link

Trying IP regex :
^(?:(?:1\d{2}|[1-9]?\d|2[0-4]\d|25[0-5])(?:\.(?!$)|$)){4}$
Is generating :
255.226124138.
9253252.112
96.119.163.252.
251.106.136.16
Only the last one is good

@bjmc
Copy link
Collaborator

bjmc commented Sep 12, 2023

Thanks for the report @David-Lannion! I'm happy to review a PR for this issue, otherwise I'll look into it when I have some free time.

In the meantime, as a workaround, there's some simpler regexes suggested here that avoid the negative lookahead. You might have more luck with one of them.

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

2 participants