copyWith method

RecursiveRegex copyWith({
  1. RegExp? startDelimiter,
  2. RegExp? endDelimiter,
  3. String? captureGroupName,
  4. bool? isMultiLine,
  5. bool? isCaseSensitive,
  6. bool? isUnicode,
  7. bool? isDotAll,
  8. bool? global,
  9. bool copyNull = false,
})

Returns a copy of RecursiveRegex, updating any values provided by this.

If copyNull is true, captureGroupName will be copied with a value of null if it is not provided with another value.

Implementation

RecursiveRegex copyWith({
  RegExp? startDelimiter,
  RegExp? endDelimiter,
  String? captureGroupName,
  bool? isMultiLine,
  bool? isCaseSensitive,
  bool? isUnicode,
  bool? isDotAll,
  bool? global,
  bool copyNull = false,
}) {
  if (!copyNull) captureGroupName ??= this.captureGroupName;
  return RecursiveRegex(
    startDelimiter: startDelimiter ?? this.startDelimiter,
    endDelimiter: endDelimiter ?? this.endDelimiter,
    captureGroupName: captureGroupName,
    multiLine: isMultiLine ?? this.isMultiLine,
    caseSensitive: isCaseSensitive ?? this.isCaseSensitive,
    unicode: isUnicode ?? this.isUnicode,
    dotAll: isDotAll ?? this.isDotAll,
    global: global ?? this.global,
  );
}