searchAndReplace method

Future<Map<String, List<(int, String, Map<int, String>)>>> searchAndReplace(
  1. String rootPath,
  2. RegExp pattern, {
  3. bool ignoreHidden = true,
  4. List<RegExp> excluded = const [],
  5. List<RegExp> allowed = const [],
  6. String? replacement,
})

Search the content of files in a root path for a RegExp pattern and replace it.

Implementation

Future<
    Map<
        String,
        List<
            (
              int matchLine,
              String lineContent,
              Map<int, String> matchPositions
            )>>> searchAndReplace(String rootPath, RegExp pattern,
        {bool ignoreHidden = true,
        List<RegExp> excluded = const [],
        List<RegExp> allowed = const [],
        String? replacement}) async =>
    await searchFilesContent(rootPath.replaceSeparator(), pattern,
        ignoreHidden: ignoreHidden,
        excluded: excluded,
        allowed: allowed,
        replacement: replacement);