globRegExpReplaces top-level property
Implementation
final List<RegExpReplace> globRegExpReplaces = [
RegExpReplace(
from: RegExp(r"((\*)?(\*))(\*)?"),
replace: (match) {
return "*";
},
),
RegExpReplace(
from: RegExp(r"((.)?(\*))"),
replace: (match) {
String dot = match.group(2) ?? "";
String two = match.group(3) ?? "";
if (dot == ".") {
return match.group(1) ?? "";
}
return "${dot}.${two}";
},
),
RegExpReplace(
from: RegExp(r"((.)?(\.)(.)?)"),
replace: (match) {
String all = match.group(1) ?? "";
if (RegExp("\\*", caseSensitive: false).hasMatch(all) == false) {
return RegExp.escape(all);
}
// print(all);
return all;
},
),
];