isUUID property

bool get isUUID

Checks if this string is a valid UUID v4 format.

Example: "123e4567-e89b-12d3-a456-426614174000".isUUID -> true.

Implementation

bool get isUUID => RegExp(
  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}$',
).hasMatch(this);