mod: format code
This commit is contained in:
@ -48,19 +48,21 @@ class IdUtils {
|
||||
}
|
||||
|
||||
// 匹配
|
||||
static Map matchAvorBv({String? input}) {
|
||||
Map result = {};
|
||||
static Map<String, dynamic> matchAvorBv({String? input}) {
|
||||
final Map<String, dynamic> result = {'': null};
|
||||
if (input == null || input == '') {
|
||||
return result;
|
||||
}
|
||||
RegExp bvRegex = RegExp(r'BV[0-9A-Za-z]{10}', caseSensitive: false);
|
||||
RegExp avRegex = RegExp(r'AV\d+', caseSensitive: false);
|
||||
final RegExp bvRegex = RegExp(r'BV[0-9A-Za-z]{10}', caseSensitive: false);
|
||||
final RegExp avRegex = RegExp(r'AV\d+', caseSensitive: false);
|
||||
|
||||
Iterable<Match> bvMatches = bvRegex.allMatches(input);
|
||||
Iterable<Match> avMatches = avRegex.allMatches(input);
|
||||
final Iterable<Match> bvMatches = bvRegex.allMatches(input);
|
||||
final Iterable<Match> avMatches = avRegex.allMatches(input);
|
||||
|
||||
List<String> bvs = bvMatches.map((match) => match.group(0)!).toList();
|
||||
List<String> avs = avMatches.map((match) => match.group(0)!).toList();
|
||||
final List<String> bvs =
|
||||
bvMatches.map((Match match) => match.group(0)!).toList();
|
||||
final List<String> avs =
|
||||
avMatches.map((Match match) => match.group(0)!).toList();
|
||||
|
||||
if (bvs.isNotEmpty) {
|
||||
result['BV'] = bvs[0].substring(0, 2).toUpperCase() + bvs[0].substring(2);
|
||||
|
||||
Reference in New Issue
Block a user