Skip to content

Add is_uuid function #31

@RaeesFatima

Description

@RaeesFatima

Validate if string matches UUID format.
Create a utility function is_uuid(text) that checks whether a given string is a valid UUID (Universally Unique Identifier).
A UUID is a 128-bit value, usually represented as a 36-character string in the form:
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

Where each x is a hexadecimal digit (0–9, a–f).
It may also accept uppercase hex letters (A–F).

Examples:
print(is_uuid("550e8400-e29b-41d4-a716-446655440000")) -> True
print(is_uuid("123e4567-e89b-12d3-a456-42661417400")) -> False (too short)

Instructions:

  1. Create the function in validators.py
  2. See and follow the used pattern
  3. Write test cases.
  4. Please do update the documentation too, github link: documentation link

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions