matchUuidv4 function

bool matchUuidv4(
  1. String uuid
)

Return true if the string uuid has a Uuid v4 format.

Implementation

bool matchUuidv4(String uuid) {
  final regExp = RegExp(
    r'^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$',
    caseSensitive: false,
  );
  return regExp.hasMatch(uuid);
}