8
8
8realdima82018-03-02 01:14:53
JavaScript
8realdima8, 2018-03-02 01:14:53

Regular expression for ipv4 and ipv6?

https://regex101.com/r/5cBm5a/1/
This regular expression is validated for both ipv4 and ipv6.
Here is an example of the data that this regular expression passes through.
2001:db8:abcd:0012:0000:0000:0000:0000
0000:0000:2001:DB8:ABCD:12::
255.255.255.0
But this regular expression does not pass validation for such addresses where the prefix is ​​used.
For example, like here
2001:db8:abcd:0012::0/112
How can I add the ability to enter a prefix?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question