aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorBobby <[email protected]>2022-11-27 12:12:37 -0500
committerBobby <[email protected]>2022-11-27 12:12:37 -0500
commit2076d462ed8c38a1202fd5ca5b20f0e07accbbee (patch)
treefd1143b1f69964193eed29e9ad84700060b34793 /docs
parentf5cb8a4d14c48f458039d608f6bd38bea13a881c (diff)
downloadedify-2076d462ed8c38a1202fd5ca5b20f0e07accbbee.tar.xz
edify-2076d462ed8c38a1202fd5ca5b20f0e07accbbee.zip
added uuid validator
Diffstat (limited to 'docs')
-rw-r--r--docs/built-in/index.rst22
1 files changed, 22 insertions, 0 deletions
diff --git a/docs/built-in/index.rst b/docs/built-in/index.rst
index c99ed40..5025195 100644
--- a/docs/built-in/index.rst
+++ b/docs/built-in/index.rst
@@ -169,3 +169,25 @@ By default, the ``url`` function matches both URLs with and without a protocol.
url('https://example.com', match=['no_proto']) # returns False
If you supply an Invalid or empty value in the ``match`` list argument, the function will raise a ``ValueError`` exception. Similarly, if you supply another data type in the ``match`` list argument, the function will raise a ``TypeError`` exception.
+
+.. code-block:: python
+
+ from edify.library import url
+
+ url('example.com', match=['invalid']) # raises ValueError
+ url('example.com', match=['no_proto', 'invalid']) # raises ValueError
+ url('example.com', match=['no_proto', 1]) # raises TypeError
+
+uuid(uuid: str)
+---------------
+
+The ``uuid`` function verifies that a string is a valid UUID. The function takes a ``string`` argument which is supposed to be a valid UUID. The function returns ``True`` if the string is a valid UUID, and ``False`` otherwise.
+
+You can use the ``uuid`` function as follows:
+
+.. code-block:: python
+
+ from edify.library import uuid
+
+ uuid('123e4567-e89b-12d3-a456-426655440000') # returns True
+ uuid('123e4567-e') # returns False