String? extractHwIdFromLines(Iterable<String> lines) {
  final pattern = RegExp(r'\b([A-Z]{2,5}\d{2,4})\b');

  for (final raw in lines) {
    final line = raw.toUpperCase();
    final match = pattern.firstMatch(line);
    if (match != null) {
      return match.group(1);
    }
  }

  return null;
}
