isSwiftCode property

bool? isSwiftCode

Checks whether the provided String is a valid Swift code.

Implementation

bool? get isSwiftCode {
  var regex = RegExp(r'(^[A-Za-z]{6}[A-Z0-9]{2}([A-Z0-9]{3})?$)');
  return regex.hasMatch(this!);
}