From 7b8661bd9ee0c7e88a68a3f8a5391f73a32138fa Mon Sep 17 00:00:00 2001 From: Bobby Date: Sat, 10 Sep 2022 20:39:15 -0400 Subject: Added docs for ipv4 and ipv6 --- docs/built-in/index.rst | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'docs') diff --git a/docs/built-in/index.rst b/docs/built-in/index.rst index ff4a684..c9407ec 100644 --- a/docs/built-in/index.rst +++ b/docs/built-in/index.rst @@ -60,3 +60,35 @@ You can use the ``phone`` function as follows: phone('123-456-7890') # returns True phone('9012') # returns False phone('+1 (615) 243-') # returns False + + +ipv4() +------ + +The ``ipv4`` function verifies that a string is a valid IPv4 address. The function takes a ``string`` argument which is supposed to be a valid IPv4 address. The function returns ``True`` if the string is a valid IPv4 address, and ``False`` otherwise. + +You can use the ``ipv4`` function as follows: + +.. code-block:: python + + from edify.library import ipv4 + + ipv4('128.128.128.128') # returns True + ipv4('128.128.128') # returns False + + +ipv6() +------ + +The ``ipv6`` function verifies that a string is a valid IPv6 address. The function takes a ``string`` argument which is supposed to be a valid IPv6 address. The function returns ``True`` if the string is a valid IPv6 address, and ``False`` otherwise. + +You can use the ``ipv6`` function as follows: + +.. code-block:: python + + from edify.library import ipv6 + + ipv6('2001:0db8:85a3:0000:0000:8a2e:0370:7334') # returns True + ipv6('2001:0db8:85a3:0000:0000:8a2e:0370') # returns False + + -- cgit v1.2.3