toRegExpValue static method
Converter: to RegExp value
Implementation
static RegExp? toRegExpValue(CliOptDef optDef, String value,
{dynamic param}) {
if (param == null) {
return RegExp(value);
}
if (param is RegExpOpt) {
return RegExp(
value,
caseSensitive: param.caseSensitive,
dotAll: param.dotAll,
multiLine: param.multiLine,
unicode: param.unicode,
);
}
if (param is String) {
var rxo = RegExpOpt.fromString(param);
return RegExp(
value,
caseSensitive: rxo.caseSensitive,
dotAll: rxo.dotAll,
multiLine: rxo.multiLine,
unicode: rxo.unicode,
);
}
return null;
}