Input

  • input: The original input text or data
  • output: The string to validate against UUID format
  • expectedOutput: The expected output to compare against.
  • Any of the input variables (input, output, expectedOutput) can be marked as optional.
  • The returned value from the validate function can be a boolean, string, or a number.

Output

  • Result: Boolean (true or false) | string | number

Interpretation

Assuming this evaluator returns a boolean
  • true: The string matches the UUID format
  • false: The string does not match the UUID format
This evaluator requires a function named validate.

Example

import re

def validate(input, output, expectedOutput):
    pattern = r'^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$'
    return re.match(pattern, str(output)) is not None