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

RegExp for IPv6 do not work propperly #29

Open
elvquant opened this issue May 9, 2016 · 2 comments
Open

RegExp for IPv6 do not work propperly #29

elvquant opened this issue May 9, 2016 · 2 comments

Comments

@elvquant
Copy link

elvquant commented May 9, 2016

Try:
var ip_regex = /([0-9]{1,3}(.[0-9]{1,3}){3}|[a-f0-9]{1,4}(:[a-f0-9]{0,4}){2,7})/

@elvquant elvquant changed the title RegExp for IPv6 do not propperly RegExp for IPv6 do not work propperly May 9, 2016
@spemmons
Copy link

spemmons commented May 9, 2016

Why is there a "." in the pattern? Is it really acceptable for any character to match in that case?

@elvquant
Copy link
Author

elvquant commented May 9, 2016

I have only changed the 2nd part (IPv6) of the pattern. 2001::1 is valid, too.

But you are right, the "." on the IPv4 part should be masked: "."
It was elliminated by the comment field here. I need to use \ to get an \ here!

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